diff options
author | Yang Tse <yangsita@gmail.com> | 2009-06-19 00:41:03 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-06-19 00:41:03 +0000 |
commit | 2c0c05e96d8b611e1f5eedea518fa1a7857804c9 (patch) | |
tree | 2003c508150ca0dfb70ff71bbdd2be0fae76d314 /lib | |
parent | d6d63147b6a5f425b1601b0576483937fe9f99d1 (diff) | |
download | curl-2c0c05e96d8b611e1f5eedea518fa1a7857804c9.tar.gz |
sclose() function-like macro definition used to close a socket,
now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
config file preprocessor definitions.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config-amigaos.h | 1 | ||||
-rw-r--r-- | lib/config.dos | 5 | ||||
-rw-r--r-- | lib/memdebug.h | 3 | ||||
-rw-r--r-- | lib/setup.h | 21 | ||||
-rw-r--r-- | lib/setup_once.h | 13 |
5 files changed, 19 insertions, 24 deletions
diff --git a/lib/config-amigaos.h b/lib/config-amigaos.h index 3da27426d..189a0a6a0 100644 --- a/lib/config-amigaos.h +++ b/lib/config-amigaos.h @@ -26,6 +26,7 @@ #ifdef __AMIGA__ /* Any AmigaOS flavour */ #define HAVE_ARPA_INET_H 1 +#define HAVE_CLOSESOCKET_CAMEL 1 #define HAVE_GETHOSTBYADDR 1 #define HAVE_INET_ADDR 1 #define HAVE_INTTYPES_H 1 diff --git a/lib/config.dos b/lib/config.dos index 26f25fd51..df4809133 100644 --- a/lib/config.dos +++ b/lib/config.dos @@ -155,6 +155,11 @@ #define HAVE_SYS_TIME_H 1 #endif +#ifdef MSDOS /* Watt-32 */ + #define HAVE_CLOSESOCKET_CAMEL 1 + #define CloseSocket(s) close_s((s)) +#endif + #undef word #undef byte diff --git a/lib/memdebug.h b/lib/memdebug.h index 4c84247b1..96cf4ad38 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -116,9 +116,6 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source); /* sclose is probably already defined, redefine it! */ #undef sclose #define sclose(sockfd) curl_sclose(sockfd,__LINE__,__FILE__) -/* ares-adjusted define: */ -#undef closesocket -#define closesocket(sockfd) curl_sclose(sockfd,__LINE__,__FILE__) #undef fopen #define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__) diff --git a/lib/setup.h b/lib/setup.h index 1ca3e9b9d..25ca451f3 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -341,7 +341,6 @@ #endif /* Below we define some functions. They should - 1. close a socket 4. set the SIGALRM signal timeout 5. set dir/file naming defines @@ -349,12 +348,6 @@ #ifdef WIN32 -# if !defined(__CYGWIN__) -# define sclose(x) closesocket(x) -# else -# define sclose(x) close(x) -# endif - # define DIR_CHAR "\\" # define DOT_CHAR "_" @@ -363,7 +356,6 @@ # ifdef MSDOS /* Watt-32 */ # include <sys/ioctl.h> -# define sclose(x) close_s(x) # define select(n,r,w,x,t) select_s(n,r,w,x,t) # define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z)) # include <tcp.h> @@ -374,21 +366,8 @@ # undef byte # endif -# else /* MSDOS */ - -# ifdef __BEOS__ -# define sclose(x) closesocket(x) -# else /* __BEOS__ */ -# define sclose(x) close(x) -# endif /* __BEOS__ */ - # endif /* MSDOS */ -# ifdef _AMIGASF -# undef sclose -# define sclose(x) CloseSocket(x) -# endif - # ifdef __minix /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */ extern char * strtok_r(char *s, const char *delim, char **last); diff --git a/lib/setup_once.h b/lib/setup_once.h index 4c4d3f599..9ad69e58d 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -230,6 +230,19 @@ struct timeval { /* + * Function-like macro definition used to close a socket. + */ + +#if defined(HAVE_CLOSESOCKET) +# define sclose(x) closesocket((x)) +#elif defined(HAVE_CLOSESOCKET_CAMEL) +# define sclose(x) CloseSocket((x)) +#else +# define sclose(x) close((x)) +#endif + + +/* * Uppercase macro versions of ANSI/ISO is*() functions/macros which * avoid negative number inputs with argument byte codes > 127. */ |