Define _POSIX_C_SOURCE=200809L

This is needed to enable localtime_r(3) used in src/slog.c
Also needed for strdup(3)
Add #ifndef to src/hiredis/fmacros.h to avoid warnings
master
Nicolas Favre-Felix 2 years ago
parent 7c66f69b21
commit 05f168fc51
No known key found for this signature in database
GPG Key ID: C04E7AA8B6F73372

@ -5,7 +5,7 @@ B64_OBJS?=src/b64/cencode.o
FORMAT_OBJS?=src/formats/json.o src/formats/raw.o src/formats/common.o src/formats/custom-type.o
HTTP_PARSER_OBJS?=src/http-parser/http_parser.o
CFLAGS ?= -std=c99 -Wall -Wextra -Isrc -Isrc/jansson/src -Isrc/http-parser -MD
CFLAGS ?= -std=c99 -Wall -Wextra -Isrc -Isrc/jansson/src -Isrc/http-parser -MD -D_POSIX_C_SOURCE=200809L
LDFLAGS ?= -levent -pthread
# Pass preprocessor macros to the compile invocation

@ -2,7 +2,9 @@
#define __HIREDIS_FMACRO_H
#define _XOPEN_SOURCE 600
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L
#endif
#if defined(__APPLE__) && defined(__MACH__)
/* Enable TCP_KEEPALIVE */

Loading…
Cancel
Save