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:
Robert Sipka 2016-06-17 13:50:21 +02:00
parent 37ebd20a72
commit c0665da299
2 changed files with 3 additions and 1 deletions

View File

@ -150,6 +150,9 @@ project (JerryCore C ASM)
# Jerry port
if(NOT ("${PORT_DIR}" STREQUAL ""))
file(GLOB SOURCE_PORT_FILES ${PORT_DIR}/*.c)
if (NOT USE_JERRY_LIBC)
set (DEFINES_JERRY ${DEFINES_JERRY} _BSD_SOURCE)
endif()
endif()
# All-in-one build

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
#define _BSD_SOURCE
#include <sys/time.h>
#include "jerry-port.h"