00001
00002
00003
00004
00005
00006
00007
00008
00016
00017
00018
00019 #ifndef WIN32_COMPATIBILITY_H
00020 #define WIN32_COMPATIBILITY_H
00021
00022 #ifdef WIN32
00023
00024 #include <stdio.h>
00025 #include <windows.h>
00026
00029 #define uid_t int
00030 #define gid_t int
00031
00033 struct passwd{
00034 char *pw_name;
00035 char *pw_passwd;
00036 uid_t pw_uid;
00037 gid_t pw_gid;
00038 char *pw_gecos;
00039 char *pw_dir;
00040 char *pw_shell;
00041 };
00043
00046 #define getuid() 1000
00047 #define geteuid() 1000
00048 extern struct passwd *getpwuid(int id);
00049
00050 #ifndef bzero
00051 extern void bzero(char* s, int l);
00052 #endif
00053
00054 #ifndef index
00055 char* index(const char * s, int i);
00056 #endif
00057
00058 #define usleep(s) Sleep(s)
00059
00060
00061 #define EINPROGRESS WSAEWOULDBLOCK
00062
00064 struct addrinfo {
00065 int ai_flags;
00066 int ai_family;
00067 int ai_socktype;
00068 int ai_protocol;
00069 size_t ai_addrlen;
00070 struct sockaddr *ai_addr;
00071 char *ai_canonname;
00072 struct addrinfo *ai_next;
00073 };
00074
00075 int win_snprintf(const char* c,...);
00076 int win_vsnprintf(const char *format, va_list ap);
00077 #define snprintf(a,b,c...) (__extension__ \
00078 ({ \
00079 int __result; \
00080 if ( a == NULL && b == 0) \
00081 __result = c99_snprintf(c); \
00082 else \
00083 __result = snprintf(a,b,c); \
00084 __result; }))
00085
00086 #define vsnprintf(a,b,c,d) (__extension__ \
00087 ({ \
00088 int __result; \
00089 if ( a == NULL && b == 0) \
00090 __result = c99_vsnprintf(c,d);\
00091 else \
00092 __result = vsnprintf(a,b,c,d); \
00093 __result; }))
00094
00095 #endif
00096
00097 #endif