libsystemd: check if _POSIX_C_SOURCE is defined

This can cause issues if sd-event.h is included in a source file that doesn't
define _POSIX_C_SOURCE and is compiled with -Wundef.
This commit is contained in:
emersion
2019-02-22 10:09:48 +09:00
committed by Yu Watanabe
parent 7e85b073c7
commit 772afb7616
+1 -1
View File
@@ -71,7 +71,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
#if defined _GNU_SOURCE || _POSIX_C_SOURCE >= 199309L
#if defined _GNU_SOURCE || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 199309L)
typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
#else
typedef void* sd_event_child_handler_t;