aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorJuanma Barranquero2006-10-31 16:40:11 +0000
committerJuanma Barranquero2006-10-31 16:40:11 +0000
commit411b80a566ce95fe19f40d296de1c89549bd4c7a (patch)
tree5430f8d118ff6e6b25651935b1ee569ddb02c5f2 /lib-src
parent95d0feaa4a914e897f202c5c0b1d8ea14524620a (diff)
downloademacs-411b80a566ce95fe19f40d296de1c89549bd4c7a.tar.gz
emacs-411b80a566ce95fe19f40d296de1c89549bd4c7a.zip
[WINDOWSNT]: Include <malloc.h> and <stdlib.h>.
(close_winsock): Declare as __cdecl.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/emacsclient.c22
2 files changed, 19 insertions, 8 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 939cb1b24c0..3a5071ddb0c 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12006-10-31 ,bS(Bscar Fuentes <ofv@wanadoo.es> (tiny change)
2
3 * emacsclient.c [WINDOWSNT]: Include <malloc.h> and <stdlib.h>.
4 (close_winsock): Declare as __cdecl.
5
12006-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 62006-10-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 7
3 * emacsclient.c [!WINDOWSNT]: Include <fcntl.h> if available. 8 * emacsclient.c [!WINDOWSNT]: Include <fcntl.h> if available.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index b7f3dd592a7..a155073c072 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -27,29 +27,35 @@ Boston, MA 02110-1301, USA. */
27#endif 27#endif
28 28
29#ifdef WINDOWSNT 29#ifdef WINDOWSNT
30#define HAVE_SOCKETS
31#define NO_SOCKETS_IN_FILE_SYSTEM
32#endif
33 30
34#ifdef WINDOWSNT 31# include <malloc.h>
32# include <stdlib.h>
33
34# define HAVE_SOCKETS
35# define NO_SOCKETS_IN_FILE_SYSTEM
36
35# define HSOCKET SOCKET 37# define HSOCKET SOCKET
36# define CLOSE_SOCKET closesocket 38# define CLOSE_SOCKET closesocket
37# define IOCTL ioctlsocket 39# define IOCTL ioctlsocket
38# define INITIALIZE() (initialize_sockets ()) 40# define INITIALIZE() (initialize_sockets ())
39typedef unsigned long IOCTL_BOOL_ARG; 41typedef unsigned long IOCTL_BOOL_ARG;
40#else 42
43#else /* !WINDOWSNT */
44
41#ifdef HAVE_FCNTL_H 45#ifdef HAVE_FCNTL_H
42# include <fcntl.h> 46# include <fcntl.h>
43#endif 47#endif
44# include <netinet/in.h> 48# include <netinet/in.h>
45# include <sys/ioctl.h> 49# include <sys/ioctl.h>
50
46# define INVALID_SOCKET -1 51# define INVALID_SOCKET -1
47# define HSOCKET int 52# define HSOCKET int
48# define CLOSE_SOCKET close 53# define CLOSE_SOCKET close
49# define IOCTL ioctl 54# define IOCTL ioctl
50# define INITIALIZE() 55# define INITIALIZE()
51typedef int IOCTL_BOOL_ARG; 56typedef int IOCTL_BOOL_ARG;
52#endif 57
58#endif /* !WINDOWSNT */
53 59
54#undef signal 60#undef signal
55 61
@@ -379,7 +385,7 @@ quote_file_name (s, name)
379 385
380#ifdef WINDOWSNT 386#ifdef WINDOWSNT
381/* Wrapper to make WSACleanup a cdecl, as required by atexit(). */ 387/* Wrapper to make WSACleanup a cdecl, as required by atexit(). */
382void close_winsock () 388void __cdecl close_winsock ()
383{ 389{
384 WSACleanup (); 390 WSACleanup ();
385} 391}
@@ -497,7 +503,7 @@ set_tcp_socket ()
497#else 503#else
498 IOCTL (s, FIONBIO, &c_arg); 504 IOCTL (s, FIONBIO, &c_arg);
499#endif 505#endif
500#endif 506#endif
501 setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg); 507 setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg);
502 508
503 /* 509 /*