Build fix for ALL_IN_ONE and COMPILER_DEFAULT_LIBC
The build fails with enabled ALL_ON_ONE and enabled COMPILER_DEFAULT_LIBC options, because the _BSD_SOURCE doesn't defined before including the sys/time.h. In case of glibc, the 'timezone' is not part of C99 but part of POSIX, so we need to define the _BSD_SOURCE feature test macro before including sys/time.h to get the prototype for this struct. JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
@@ -150,6 +150,9 @@ project (JerryCore C ASM)
|
|||||||
# Jerry port
|
# Jerry port
|
||||||
if(NOT ("${PORT_DIR}" STREQUAL ""))
|
if(NOT ("${PORT_DIR}" STREQUAL ""))
|
||||||
file(GLOB SOURCE_PORT_FILES ${PORT_DIR}/*.c)
|
file(GLOB SOURCE_PORT_FILES ${PORT_DIR}/*.c)
|
||||||
|
if (NOT USE_JERRY_LIBC)
|
||||||
|
set (DEFINES_JERRY ${DEFINES_JERRY} _BSD_SOURCE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# All-in-one build
|
# All-in-one build
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _BSD_SOURCE
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include "jerry-port.h"
|
#include "jerry-port.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user