mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
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
This commit is contained in:
parent
d60d4dbba9
commit
575ec7e10a
@ -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 <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user