Explorar o código

setting macros again, ref #212

Stasik0 %!s(int64=10) %!d(string=hai) anos
pai
achega
82737a2986
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      examples/networklayer_tcp.c

+ 9 - 1
examples/networklayer_tcp.c

@@ -18,7 +18,15 @@
 #include <sys/socketvar.h>
 #include <sys/ioctl.h>
 #include <netdb.h> //gethostbyname for the client
-#define __USE_BSD
+#ifndef _BSD_SOURCE
+	#define _BSD_SOURCE
+#endif
+#ifndef _DEFAULT_SOURCE
+	#define _DEFAULT_SOURCE
+#endif
+#ifndef __USE_BSD
+	#define __USE_BSD
+#endif
 #include <unistd.h> // read, write, close
 #include <arpa/inet.h>
 #define CLOSESOCKET(S) close(S)