File tree 6 files changed +4
-12
lines changed
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)
21
21
22
22
export CC
23
23
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
25
25
CFLAGS += -g -Wall -Werror=return-type -Wno-unused-function $(shell curl-config --cflags)
26
26
27
27
ifdef STATIC
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ url_data_inspect (url_data_t *data);
156
156
#ifdef URL_H_IMPLEMENTATION
157
157
158
158
// non C99 standard functions
159
- #if _POSIX_C_SOURCE < 200809L
159
+ #if _POSIX_C_SOURCE < 200809L && !(defined URL_H_NO_STRDUP )
160
160
char *
161
161
strdup (const char * str ) {
162
162
int n = strlen (str ) + 1 ;
Original file line number Diff line number Diff line change 12
12
#include <stdio.h>
13
13
#include <string.h>
14
14
15
- #if defined(__unix__ ) || (defined(__APPLE__ ) && defined(__MACH__ ))
16
- #include <unistd.h>
17
- #endif
18
-
19
15
#ifdef HAVE_PTHREADS
20
16
#include <pthread.h>
21
17
#endif
Original file line number Diff line number Diff line change 12
12
#include <stdio.h>
13
13
#include <string.h>
14
14
15
- #if defined(__unix__ ) || (defined(__APPLE__ ) && defined(__MACH__ ))
16
- #include <unistd.h>
17
- #endif
18
-
19
15
#ifdef HAVE_PTHREADS
20
16
#include <pthread.h>
21
17
#endif
Original file line number Diff line number Diff line change 7
7
8
8
#include "asprintf/asprintf.h"
9
9
#include "commander/commander.h"
10
- #include "common/clib-package.h"
11
10
#include "debug/debug.h"
12
- #include "fs/fs.h"
13
11
#include "logger/logger.h"
14
12
#include "parson/parson.h"
15
13
#include "version.h"
16
14
#include <stdio.h>
17
15
#include <stdlib.h>
18
16
#include <string.h>
19
17
#include <unistd.h>
18
+ #include <strdup/strdup.h>
20
19
21
20
#if defined(_WIN32 ) || defined(WIN32 ) || defined(__MINGW32__ ) || \
22
21
defined(__MINGW64__ ) || defined(__CYGWIN__ )
Original file line number Diff line number Diff line change 1
1
#define URL_H_IMPLEMENTATION
2
+ #define URL_H_NO_STRDUP
2
3
#include "url/url.h"
3
4
4
5
// 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