File tree Expand file tree Collapse file tree 6 files changed +4
-12
lines changed Expand file tree Collapse file tree 6 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ OBJS = $(DEPS:.c=.o)
2121
2222export CC
2323
24- CFLAGS += -std=gnu17 -Ideps -Isrc/common -Isrc/repository -Isrc/registry
24+ CFLAGS += -std=c17 -U__STRICT_ANSI__ -Ideps -Isrc/common -Isrc/repository -Isrc/registry
2525CFLAGS += -g -Wall -Werror=return-type -Wno-unused-function $(shell curl-config --cflags)
2626
2727ifdef STATIC
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ url_data_inspect (url_data_t *data);
156156#ifdef URL_H_IMPLEMENTATION
157157
158158// non C99 standard functions
159- #if _POSIX_C_SOURCE < 200809L
159+ #if _POSIX_C_SOURCE < 200809L && !(defined URL_H_NO_STRDUP )
160160char *
161161strdup (const char * str ) {
162162 int n = strlen (str ) + 1 ;
Original file line number Diff line number Diff line change 1212#include <stdio.h>
1313#include <string.h>
1414
15- #if defined(__unix__ ) || (defined(__APPLE__ ) && defined(__MACH__ ))
16- #include <unistd.h>
17- #endif
18-
1915#ifdef HAVE_PTHREADS
2016#include <pthread.h>
2117#endif
Original file line number Diff line number Diff line change 1212#include <stdio.h>
1313#include <string.h>
1414
15- #if defined(__unix__ ) || (defined(__APPLE__ ) && defined(__MACH__ ))
16- #include <unistd.h>
17- #endif
18-
1915#ifdef HAVE_PTHREADS
2016#include <pthread.h>
2117#endif
Original file line number Diff line number Diff line change 77
88#include "asprintf/asprintf.h"
99#include "commander/commander.h"
10- #include "common/clib-package.h"
1110#include "debug/debug.h"
12- #include "fs/fs.h"
1311#include "logger/logger.h"
1412#include "parson/parson.h"
1513#include "version.h"
1614#include <stdio.h>
1715#include <stdlib.h>
1816#include <string.h>
1917#include <unistd.h>
18+ #include <strdup/strdup.h>
2019
2120#if defined(_WIN32 ) || defined(WIN32 ) || defined(__MINGW32__ ) || \
2221 defined(__MINGW64__ ) || defined(__CYGWIN__ )
Original file line number Diff line number Diff line change 11#define URL_H_IMPLEMENTATION
2+ #define URL_H_NO_STRDUP
23#include "url/url.h"
34
45// This is a bit of a hack to use url.h in multiple files.
You can’t perform that action at this time.
0 commit comments