Smaller
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1879 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
25459dcb70
commit
53d954e00b
7 changed files with 160 additions and 259 deletions
|
@ -9,53 +9,24 @@
|
|||
#ifndef _NETINC_H_
|
||||
#define _NETINC_H_
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "util.h"
|
||||
|
||||
#define strcasecmp(x,y) stricmp(x,y)
|
||||
#define ERRNO (WSAGetLastError())
|
||||
#define SET_SOCK_BLOCK(s,block) { unsigned long __i=block?0:1; ioctlsocket(s,FIONBIO,&__i); }
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EINPROGRESS WSAEWOULDBLOCK
|
||||
#define memset mini_memset
|
||||
#define memcpy mini_memcpy
|
||||
#define strcpy lstrcpy
|
||||
#define strncpy lstrcpyn
|
||||
#define strcat lstrcat
|
||||
#define strlen lstrlen
|
||||
#define malloc(x) (new char[x])
|
||||
#define free(x) {delete x;}
|
||||
typedef int socklen_t;
|
||||
|
||||
#else
|
||||
|
||||
#ifndef THREAD_SAFE
|
||||
#define THREAD_SAFE
|
||||
#endif
|
||||
#ifndef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/time.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#define ERRNO errno
|
||||
#define closesocket(s) close(s)
|
||||
#define SET_SOCK_BLOCK(s,block) { int __flags; if ((__flags = fcntl(s, F_GETFL, 0)) != -1) { if (!block) __flags |= O_NONBLOCK; else __flags &= ~O_NONBLOCK; fcntl(s, F_SETFL, __flags); } }
|
||||
|
||||
#define stricmp(x,y) strcasecmp(x,y)
|
||||
#define strnicmp(x,y,z) strncasecmp(x,y,z)
|
||||
#define wsprintf sprintf
|
||||
|
||||
#endif // !_WIN32
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE 0xffffffff
|
||||
#endif
|
||||
|
@ -68,15 +39,4 @@ typedef int socklen_t;
|
|||
#define SHUT_RDWR 2
|
||||
#endif
|
||||
|
||||
extern void mini_memset(void *,char,int);
|
||||
extern void mini_memcpy(void *,void*,int);
|
||||
#define memset mini_memset
|
||||
#define memcpy mini_memcpy
|
||||
#define strcpy lstrcpy
|
||||
#define strncpy lstrcpyn
|
||||
#define strcat lstrcat
|
||||
#define strlen lstrlen
|
||||
#define malloc(x) GlobalAlloc(GPTR,(x))
|
||||
#define free(x) { if (x) GlobalFree(x); }
|
||||
|
||||
#endif //_NETINC_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue