comparison src/win32/libc_interface.h @ 10589:0f7452b1f777

[gaim-migrate @ 11994] Use GLib 2.6's gstdio functions. This should fix gaim not liking non-ascii filenames in win32. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 11 Feb 2005 05:10:40 +0000
parents 45bcc3edd8c3
children e46b51de549a
comparison
equal deleted inserted replaced
10588:529111933c9c 10589:0f7452b1f777
25 #include <winsock2.h> 25 #include <winsock2.h>
26 #include <ws2tcpip.h> 26 #include <ws2tcpip.h>
27 #include <io.h> 27 #include <io.h>
28 #include <errno.h> 28 #include <errno.h>
29 #include "libc_internal.h" 29 #include "libc_internal.h"
30 #include <glib.h>
30 31
31 /* sys/socket.h */ 32 /* sys/socket.h */
32 extern int wgaim_socket(int namespace, int style, int protocol); 33 extern int wgaim_socket(int namespace, int style, int protocol);
33 #define socket( namespace, style, protocol ) \ 34 #define socket( namespace, style, protocol ) \
34 wgaim_socket( namespace, style, protocol ) 35 wgaim_socket( namespace, style, protocol )
65 /* fcntl.h */ 66 /* fcntl.h */
66 extern int wgaim_fcntl(int socket, int command, int val); 67 extern int wgaim_fcntl(int socket, int command, int val);
67 #define fcntl( fd, command, val ) \ 68 #define fcntl( fd, command, val ) \
68 wgaim_fcntl( fd, command, val ) 69 wgaim_fcntl( fd, command, val )
69 70
70 #define open( args... ) _open( args ) 71 #if !GLIB_CHECK_VERSION(2,6,0)
72 # define open( args... ) _open( args )
73 #endif
71 74
72 /* arpa/inet.h */ 75 /* arpa/inet.h */
73 extern int wgaim_inet_aton(const char *name, struct in_addr *addr); 76 extern int wgaim_inet_aton(const char *name, struct in_addr *addr);
74 #define inet_aton( name, addr ) \ 77 #define inet_aton( name, addr ) \
75 wgaim_inet_aton( name, addr ) 78 wgaim_inet_aton( name, addr )
87 extern char* wgaim_strerror( int errornum ); 90 extern char* wgaim_strerror( int errornum );
88 #define hstrerror( herror ) \ 91 #define hstrerror( herror ) \
89 wgaim_strerror( errno ) 92 wgaim_strerror( errno )
90 #define strerror( errornum ) \ 93 #define strerror( errornum ) \
91 wgaim_strerror( errornum ) 94 wgaim_strerror( errornum )
92
93 extern char* wgaim_strsep(char **stringp, const char *delim);
94 #define strsep( stringp, delim ) \
95 wgaim_strsep( stringp, delim )
96 95
97 #define bzero( dest, size ) memset( dest, 0, size ) 96 #define bzero( dest, size ) memset( dest, 0, size )
98 97
99 /* unistd.h */ 98 /* unistd.h */
100 extern int wgaim_read(int fd, void *buf, unsigned int size); 99 extern int wgaim_read(int fd, void *buf, unsigned int size);
124 123
125 /* stdio.h */ 124 /* stdio.h */
126 #define snprintf _snprintf 125 #define snprintf _snprintf
127 #define vsnprintf _vsnprintf 126 #define vsnprintf _vsnprintf
128 127
128 #if !GLIB_CHECK_VERSION(2,6,0)
129 /* I think that this can probably go away, in favor of g_rename() */
129 extern int wgaim_rename(const char *oldname, const char *newname); 130 extern int wgaim_rename(const char *oldname, const char *newname);
130 #define rename( oldname, newname ) \ 131 #define rename( oldname, newname ) \
131 wgaim_rename( oldname, newname ) 132 wgaim_rename( oldname, newname )
133 #endif
132 134
133 /* sys/stat.h */ 135 /* sys/stat.h */
136
137 #if !GLIB_CHECK_VERSION(2,6,0)
134 #define mkdir(a,b) _mkdir((a)) 138 #define mkdir(a,b) _mkdir((a))
139 #endif
135 #define fchmod(a,b) 140 #define fchmod(a,b)
136 141
137 /* time.h */ 142 /* time.h */
138 extern struct tm *wgaim_localtime_r(const time_t *time, struct tm *resultp); 143 extern struct tm *wgaim_localtime_r(const time_t *time, struct tm *resultp);
139 #define localtime_r( time, resultp ) \ 144 #define localtime_r( time, resultp ) \