diff --git a/configure.ac b/configure.ac index 8cc707fd33..6e1b7200de 100644 --- a/configure.ac +++ b/configure.ac @@ -1384,10 +1384,7 @@ then AC_SUBST(WEBKIT_CFLAGS) AC_SUBST(WEBKIT_LIBS) - dnl if Mac OSX, also scrub /sw/include - dnl GIVEN_CFLAGS=$(echo $GIVEN_CFLAGS | sed -e "s;-I/sw/include ;;" | sed -e "s;-I/sw/include$;;") - - ###----------------------------------------------------------------------- + ###----------------------------------------------------------------------- ## Find a suitable password store AC_ARG_ENABLE([password-storage], AS_HELP_STRING([--disable-password-storage], [Ignore system wide password stores such as gnome-keyring, libsecret or Apple's keychain])) @@ -1510,20 +1507,8 @@ then AC_DEFINE(GNOME_DISABLE_DEPRECATED,1, [Don't use deprecated gnome functions]) fi -###------------------------------------------------------------------------- -### Stuff from Mac OS X Port -###------------------------------------------------------------------------- - AC_CHECK_FUNCS(pthread_mutex_init) -case $host_os in - darwin*) - AC_REPLACE_FUNCS(localtime_r gmtime_r) - AC_LIBOBJ(strptime) - ;; - *) - AC_REPLACE_FUNCS(strptime localtime_r gmtime_r strfmon) - ;; -esac +AC_REPLACE_FUNCS(strptime strfmon) if test x$am_cv_val_LC_MESSAGES = "xno"; then LC_MESSAGES_ENUM="LC_ALL" diff --git a/lib/libc/Makefile.am b/lib/libc/Makefile.am index 56754db10a..f0b9509fa5 100644 --- a/lib/libc/Makefile.am +++ b/lib/libc/Makefile.am @@ -2,8 +2,6 @@ noinst_LTLIBRARIES = libc-missing.la # All header files must be listed. noinst_HEADERS = \ - gmtime_r.h \ - localtime_r.h \ setenv.h \ strfmon.h \ strptime.h \ @@ -13,8 +11,6 @@ noinst_HEADERS = \ libc_missing_la_SOURCES = libc-missing-noop.c EXTRA_libc_missing_la_SOURCES = \ - gmtime_r.c \ - localtime_r.c \ setenv.c \ strfmon.c \ strptime.c diff --git a/lib/libc/gmtime_r.c b/lib/libc/gmtime_r.c deleted file mode 100644 index f378ea52b5..0000000000 --- a/lib/libc/gmtime_r.c +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************** - * File: gmtime_r.c - * Renamed from: core-utils.h - * - * Copyright (C) 2001 Linux Developers Group - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - ********************************************************************/ - -#include "config.h" - -#if !HAVE_GMTIME_R -#include -#include -#include "gmtime_r.h" - -#if HAVE_PTHREAD_MUTEX_INIT -#include -#ifdef gmtime_r -#undef gmtime_r -#endif - -struct tm * -gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - static pthread_mutex_t time_mutex; - static int time_mutex_inited = 0; - struct tm *tmp; - - if (!time_mutex_inited) - { - time_mutex_inited = 1; - pthread_mutex_init(&time_mutex, NULL); - } - - pthread_mutex_lock(&time_mutex); - tmp = gmtime(timep); - if (tmp) - { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - pthread_mutex_unlock(&time_mutex); - - return tmp; -} -#else -struct tm * -gmtime_r(const time_t *const timep, struct tm *p_tm) -{ - static struct tm* tmp; - tmp = gmtime(timep); - if (tmp) - { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - return tmp; -} -#endif /* HAVE_PTHREAD_MUTEX_INIT */ - -#endif /* !HAVE_GMTIME_R */ diff --git a/lib/libc/gmtime_r.h b/lib/libc/gmtime_r.h deleted file mode 100644 index 51e442ccca..0000000000 --- a/lib/libc/gmtime_r.h +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************** - * File: gmtime_r.h - * - * Copyright (C) 2001 Linux Developers Group - * Copyright (C) 2009 Phil Longstaff - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - ********************************************************************/ - -#ifndef __GMTIME_R_H__ -#define __GMTIME_R_H__ - -#if !HAVE_GMTIME_R -#include -/* - * Version of "gmtime_r()", for the benefit of OSes that don't have it. - */ -extern struct tm *gmtime_r(const time_t *const timep, struct tm *p_tm); -#endif - -#endif - diff --git a/lib/libc/localtime_r.c b/lib/libc/localtime_r.c deleted file mode 100644 index 738ad85d26..0000000000 --- a/lib/libc/localtime_r.c +++ /dev/null @@ -1,56 +0,0 @@ - -#include "config.h" - -#if !HAVE_LOCALTIME_R -#include -#include -#include "localtime_r.h" - -#if HAVE_PTHREAD_MUTEX_INIT -#include - -/* New mingw pthread package seems to define localtime_r as a macro */ -#ifdef localtime_r -#undef localtime_r -#endif - -struct tm * -localtime_r(const time_t *const timep, struct tm *p_tm) -{ - static pthread_mutex_t time_mutex; - static int time_mutex_inited = 0; - struct tm *tmp; - - if (!time_mutex_inited) - { - time_mutex_inited = 1; - pthread_mutex_init(&time_mutex, NULL); - } - - pthread_mutex_lock(&time_mutex); - tmp = localtime(timep); - if (tmp) - { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - pthread_mutex_unlock(&time_mutex); - - return tmp; -} -#else -struct tm * -localtime_r(const time_t *const timep, struct tm *p_tm) -{ - static struct tm* tmp; - tmp = localtime(timep); - if (tmp) - { - memcpy(p_tm, tmp, sizeof(struct tm)); - tmp = p_tm; - } - return tmp; -} -#endif /* HAVE_PTHREAD_MUTEX_INIT */ - -#endif /* !HAVE_LOCALTIME_R */ diff --git a/lib/libc/localtime_r.h b/lib/libc/localtime_r.h deleted file mode 100644 index 96fa503fb9..0000000000 --- a/lib/libc/localtime_r.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __LOCALTIME_R_H__ -#define __LOCALTIME_R_H__ -#include -/* - * Version of "localtime_r()", for the benefit of OSes that don't have it. - */ -extern struct tm *localtime_r(const time_t *const timep, struct tm *p_tm); - -#endif - diff --git a/src/backend/dbi/gnc-backend-dbi.c b/src/backend/dbi/gnc-backend-dbi.c index 8c96bd0949..ccdf251a8f 100644 --- a/src/backend/dbi/gnc-backend-dbi.c +++ b/src/backend/dbi/gnc-backend-dbi.c @@ -36,9 +36,6 @@ #include #include #include -#if !HAVE_GMTIME_R -#include "gmtime_r.h" -#endif #include "gnc-backend-dbi-priv.h" diff --git a/src/gnome-utils/gnc-date-format.c b/src/gnome-utils/gnc-date-format.c index 27fabba750..cab0209606 100644 --- a/src/gnome-utils/gnc-date-format.c +++ b/src/gnome-utils/gnc-date-format.c @@ -41,10 +41,6 @@ #include "dialog-utils.h" #include "gnc-engine.h" -#ifndef HAVE_LOCALTIME_R -# include "localtime_r.h" -#endif - /* Perhaps it's better just to use MAX_DATE_LENGTH defined in gnc-date.h */ #define MAX_DATE_LEN 80 diff --git a/src/libqof/CMakeLists.txt b/src/libqof/CMakeLists.txt index 4f9c516f8c..80f91b038e 100644 --- a/src/libqof/CMakeLists.txt +++ b/src/libqof/CMakeLists.txt @@ -40,8 +40,6 @@ IF (WIN32) SET (libgnc_qof_SOURCES ${libgnc_qof_SOURCES} qof/qof-win32.c ../../lib/libc/strptime.c - ../../lib/libc/localtime_r.c - ../../lib/libc/gmtime_r.c ) ENDIF (WIN32) diff --git a/src/libqof/qof/qoflog.cpp b/src/libqof/qof/qoflog.cpp index faf9781595..f33b8820bb 100644 --- a/src/libqof/qof/qoflog.cpp +++ b/src/libqof/qof/qoflog.cpp @@ -54,10 +54,6 @@ extern "C" #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "qof.log" -#ifndef HAVE_LOCALTIME_R -#include "localtime_r.h" -#endif - #ifdef __cplusplus } #endif