comparison src/proxy.c @ 13648:3eba1e7458c7

[gaim-migrate @ 16049] __unix__ is not defined in Mac OS X [1], but this code for asynchronous DNS lookups works fine on that platform (at least as of OS X 10.3.9). We now check for __unix__ or __APPLE__ being defined. [1] http://developer.apple.com/technotes/tn2002/tn2071.html - under the section "Predefined Macros" committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Mon, 17 Apr 2006 19:28:15 +0000
parents 2e10680b7545
children 6bee2e80e42c
comparison
equal deleted inserted replaced
13647:1003b97adce9 13648:3eba1e7458c7
259 } 259 }
260 /************************************************************************** 260 /**************************************************************************
261 * Proxy API 261 * Proxy API
262 **************************************************************************/ 262 **************************************************************************/
263 263
264 #ifdef __unix__ 264 #if defined(__unix__) || defined(__APPLE__)
265 265
266 /* 266 /*
267 * This structure represents both a pending DNS request and 267 * This structure represents both a pending DNS request and
268 * a free child process. 268 * a free child process.
269 */ 269 */
766 req->inpa = gaim_input_add(req->fd_out, GAIM_INPUT_READ, host_resolved, req); 766 req->inpa = gaim_input_add(req->fd_out, GAIM_INPUT_READ, host_resolved, req);
767 767
768 return 0; 768 return 0;
769 } 769 }
770 770
771 #elif defined _WIN32 /* end __unix__ */ 771 #elif defined _WIN32 /* end __unix__ || __APPLE__ */
772 772
773 typedef struct _dns_tdata { 773 typedef struct _dns_tdata {
774 char *hostname; 774 char *hostname;
775 int port; 775 int port;
776 dns_callback_t callback; 776 dns_callback_t callback;
880 return -1; 880 return -1;
881 } 881 }
882 return 0; 882 return 0;
883 } 883 }
884 884
885 #else /* not __unix__ or _WIN32 */ 885 #else /* not __unix__ or __APPLE__ or _WIN32 */
886 886
887 typedef struct { 887 typedef struct {
888 gpointer data; 888 gpointer data;
889 size_t addrlen; 889 size_t addrlen;
890 struct sockaddr *addr; 890 struct sockaddr *addr;
931 req->callback = callback; 931 req->callback = callback;
932 gaim_timeout_add(10, host_resolved, req); 932 gaim_timeout_add(10, host_resolved, req);
933 return 0; 933 return 0;
934 } 934 }
935 935
936 #endif /* not __unix__ or _WIN32 */ 936 #endif /* not __unix__ or __APPLE__ or _WIN32 */
937 937
938 static void 938 static void
939 no_one_calls(gpointer data, gint source, GaimInputCondition cond) 939 no_one_calls(gpointer data, gint source, GaimInputCondition cond)
940 { 940 {
941 struct PHB *phb = data; 941 struct PHB *phb = data;