From 8c1f4d7bace6ff2c99d546cedaba890b349e88f8 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 16 Jan 2009 23:55:53 +0000 Subject: I...think that's a little better. Wow, function pointers in windows have a lot of problems. This may require a little more research, but basically, you can't just call them inline wherever you'd like. I managed to get it to work by providing simple one line wrapper functions for each function we acquired as a pointer. Crazy mess. Anyway, it should load the library just once now, and Bu::Socket looks a little bit cleaner, but not a heck of a lot. I also added some more docs and removed the author references. --- src/linux_compatibility.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/linux_compatibility.h (limited to 'src/linux_compatibility.h') diff --git a/src/linux_compatibility.h b/src/linux_compatibility.h new file mode 100644 index 0000000..67016a7 --- /dev/null +++ b/src/linux_compatibility.h @@ -0,0 +1,21 @@ +#ifdef __linux__ + +#define bu_inet_ntoa inet_ntoa +#define bu_inet_addr inet_addr +#define bu_select select +#define bu_socket socket +#define bu_htons htons +#define bu_htonl htonl +#define bu_gethostbyname gethostbyname +#define bu_freeaddrinfo freeaddrinfo +#define bu_getaddrinfo getaddrinfo +#define bu_connect connect +#define bu_getpeername getpeername +#define bu_setsockopt setsockopt +#define bu_bind bind +#define bu_listen listen +#define bu_accept accept + +#define bu_gai_strerror gai_strerror + +#endif -- cgit v1.2.3