Преглед на файлове

setting macros again, ref #212

Stasik0 преди 10 години
родител
ревизия
82737a2986
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  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)