revert - we will store them in a common (AROS) location.
[AROS-Contrib.git] / SDL / SDL_net / SDL_net-1.2.7-aros.diff
blob68688449c92817fb21902ca7beed4797fbf87071
1 diff -ruN SDL_net-1.2.7/SDLnet.c SDL_net-1.2.7.aros/SDLnet.c
2 --- SDL_net-1.2.7/SDLnet.c 2007-07-02 04:04:03.000000000 +0200
3 +++ SDL_net-1.2.7.aros/SDLnet.c 2011-03-12 11:51:28.977323996 +0100
4 @@ -29,6 +29,11 @@
5 #include "SDLnetsys.h"
6 #include "SDL_net.h"
8 +#ifdef __AROS__
9 +#include <proto/exec.h>
10 +struct Library * SocketBase = NULL;
11 +extern int errno;
12 +#endif
14 const SDL_version *SDLNet_Linked_Version(void)
16 @@ -292,6 +297,17 @@
17 SDLNet_SetError("Couldn't initialize Winsock 1.1\n");
18 return(-1);
20 +#elif defined __AROS__
21 + if ( !(SocketBase = OpenLibrary("bsdsocket.library", 4 ))) {
22 + SDLNet_SetError("No TCP/IP Stack running!\n");
23 + return(-1);
24 + }
26 + if ( SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (IPTR)&errno,
27 + TAG_DONE )) {
28 + SDLNet_SetError("Error initializing bsdsocket\n");
29 + return(-1);
30 + }
31 #else
32 /* SIGPIPE is generated when a remote socket is closed */
33 void (*handler)(int);
34 @@ -318,6 +334,11 @@
35 WSACleanup();
38 +#elif defined __AROS__
39 + if ( SocketBase ) {
40 + CloseLibrary(SocketBase);
41 + SocketBase = NULL;
42 + }
43 #else
44 /* Restore the SIGPIPE handler */
45 void (*handler)(int);
46 diff -ruN SDL_net-1.2.7/SDLnetsys.h SDL_net-1.2.7.aros/SDLnetsys.h
47 --- SDL_net-1.2.7/SDLnetsys.h 2007-07-02 04:04:03.000000000 +0200
48 +++ SDL_net-1.2.7.aros/SDLnetsys.h 2011-03-12 13:38:02.083471002 +0100
49 @@ -60,6 +60,10 @@
50 #endif
51 #include <netdb.h>
52 #include <sys/socket.h>
53 +#ifdef __AROS__
54 +#include <proto/socket.h>
55 +#include <bsdsocket/socketbasetags.h>
56 +#endif /* AROS */
57 #endif /* WIN32 */
58 #endif /* Open Transport */