jeremycw / httpserver.h

Single header library for writing non-blocking HTTP servers in C
MIT License
1.78k stars 143 forks source link

About : warning: "_POSIX_C_SOURCE" redefined #52

Open patrickj-fd opened 3 years ago

patrickj-fd commented 3 years ago

When I compile my project with httpserver.h, occur warning :

./src/httpserver.h:295:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 199309L

In file included from /usr/include/x86_64-linux-gnu/sys/types.h:25:0,
                 from /usr/include/x86_64-linux-gnu/curl/system.h:399,
                 from /usr/include/x86_64-linux-gnu/curl/curl.h:38,
                 from ./src/hr_darknet.c:1:
/usr/include/features.h:265:0: note: this is the location of the previous definition
# define _POSIX_C_SOURCE 200809L

Its must be '199309L' in the httpserver.h?

For fix the warning, can I modify httpserver.h like this:

#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE
#endif

Thanks.