Parcourir la source

setting macros again, ref #212

Stasik0 il y a 10 ans
Parent
commit
82737a2986
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  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)