Skip to content
Snippets Groups Projects
Commit 98318335 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

typedef a socket_buffer_t

This is so we can deal with send(), recv() and friends taking
a void* on BSD stacks, and a char* on Win32.

Not a big deal for C where a void* is universal, but C++ hates that
type of thing.
parent ce1a2902
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
/* OS-specific */ /* OS-specific */
/***************/ /***************/
#if defined(_WIN32) /* Use WinSock */ #if defined(_WIN32) /* Use WinSock */
typedef char* socket_buffer_t;
#ifndef _WINSOCKAPI_ #ifndef _WINSOCKAPI_
#include <winsock2.h> /* socket/bind/etc. */ #include <winsock2.h> /* socket/bind/etc. */
...@@ -50,7 +51,8 @@ ...@@ -50,7 +51,8 @@
#endif #endif
#elif defined __unix__ /* Unix-variant */ #elif defined __unix__ /* Unix-variant */
typedef void* socket_buffer_t;
#include <netdb.h> /* gethostbyname */ #include <netdb.h> /* gethostbyname */
#include <sys/types.h> /* For u_int32_t on FreeBSD */ #include <sys/types.h> /* For u_int32_t on FreeBSD */
#include <netinet/in.h> /* IPPROTO_IP */ #include <netinet/in.h> /* IPPROTO_IP */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment