From 199f41bd09ff654de8321a6165d13fdef82c6821 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 3 Dec 2017 20:27:08 +1030 Subject: [PATCH 06/13] Fix implicit declation if localtime_r in glib/demo/utils.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /home/asj/poppler/glib/demo/utils.c: In function ‘pgd_format_date’: /home/asj/poppler/glib/demo/utils.c:496:20: warning: implicit declaration of function ‘localtime_r’ [-Wimplicit-function-declaration] --- glib/demo/utils.c | 1 + goo/glibc.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/glib/demo/utils.c b/glib/demo/utils.c index aa6cd761..4b36ae5e 100644 --- a/glib/demo/utils.c +++ b/glib/demo/utils.c @@ -21,6 +21,7 @@ #include #include +#include "goo/glibc.h" #include "utils.h" void diff --git a/goo/glibc.h b/goo/glibc.h index 8b372bca..715e4c0b 100644 --- a/goo/glibc.h +++ b/goo/glibc.h @@ -17,7 +17,9 @@ #include +#ifdef __cplusplus extern "C" { +#endif #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t *timep, struct tm *result); @@ -35,7 +37,9 @@ time_t timegm(struct tm *tm); char * strtok_r (char *s, const char *delim, char **save_ptr); #endif +#ifdef __cplusplus } +#endif #endif // GLIBC_H -- 2.11.0