From a2f625e5dbf8350ffec57627412d1237f71c31bc Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 1 Oct 2017 12:53:38 +1030 Subject: [PATCH 02/23] =?UTF-8?q?Fix=20warning:=20implicit=20declaration?= =?UTF-8?q?=20of=20function=20=E2=80=98localtime=5Fr=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit poppler/glib/demo/utils.c:488:20: warning: implicit declaration of function ‘localtime_r’ [-Wimplicit-function-declaration] if (time == 0 || !localtime_r (&time, &t)) return NULL; ^~~~~~~~~~~ The c files also need the -D_DEFAULT_SOURCE feature macro to enable non standard C++11 functons. --- cmake/modules/PopplerMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake index ba4bceb3..05b69476 100644 --- a/cmake/modules/PopplerMacros.cmake +++ b/cmake/modules/PopplerMacros.cmake @@ -132,7 +132,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline ${_save_cxxflags}") set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs ${_save_cxxflags}") set(_save_cflags "${CMAKE_C_FLAGS}") - set(CMAKE_C_FLAGS "-std=c99") + set(CMAKE_C_FLAGS "-std=c99 -D_DEFAULT_SOURCE") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g ${_save_cflags}") set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG ${_save_cflags}") set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline ${_save_cflags}") -- 2.11.0