From 575ec7e10ad48c8daad7db88a64c3aadb87bf788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=A1l?= Date: Fri, 2 Mar 2018 02:17:25 +0100 Subject: [PATCH] Check _XOPEN_SOURCE macro before defining (#2220) In jrt.h the _XOPEN_SOURCE macro is defined. However if the compiler already specifies this as a default define, it can lead to compiler warnings or errors. By adding a macro check the warnings/errors can be avoided. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com --- jerry-core/jrt/jrt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index b947fc5fd..46ab6b203 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -16,8 +16,11 @@ #ifndef JRT_H #define JRT_H +#if !defined (_XOPEN_SOURCE) || _XOPEN_SOURCE < 500 +#undef _XOPEN_SOURCE /* Required macro for sleep functions (nanosleep or usleep) */ #define _XOPEN_SOURCE 500 +#endif #include #include