aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-05-08 12:39:54 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-05-08 12:39:54 +0100
commita4c44e5e744dba15dfe512668127906afd4b6dba (patch)
tree684068057eedd2641af4ccad70c005fd96897b4b
parentector_software_rasterizer: Support gradient mask blending (diff)
downloadefl-a4c44e5e744dba15dfe512668127906afd4b6dba.tar.gz
Evil: remove localtime_r as mingw-w64 defines it when _POSIX_C_SOURCE is defined
Summary: localtime_r() is already defined by mingw-w64 when _POSIX_C_SOURCE is defined Test Plan: compilation Reviewers: raster, zmike, cedric Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/T7907 Differential Revision: https://phab.enlightenment.org/D8854
-rw-r--r--configure.ac1
-rw-r--r--meson.build1
-rw-r--r--src/lib/evil/evil_macro_wrapper.h14
-rw-r--r--src/lib/evil/evil_time.c10
-rw-r--r--src/lib/evil/evil_time.h23
5 files changed, 5 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac
index 57ae1f51a5..5b64175c81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,6 +265,7 @@ case "$host_vendor" in
;;
esac
+AC_DEFINE([_POSIX_C_SOURCE], [1], [Define the POSIX version])
AC_SUBST([MODULE_ARCH])
AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])
diff --git a/meson.build b/meson.build
index 2595461c62..b5856468cf 100644
--- a/meson.build
+++ b/meson.build
@@ -97,6 +97,7 @@ add_global_arguments(dev_cflags, language: 'cpp')
foreach lang : ['c', 'objc', 'cpp']
add_global_arguments('-DHAVE_CONFIG_H=1', language: lang)
add_global_arguments('-D_GNU_SOURCE=1', language: lang)
+ add_global_arguments('-D_POSIX_C_SOURCE=1', language: lang)
add_global_arguments('-DEFL_BETA_API_SUPPORT=1', language: lang)
add_global_arguments('-DNEED_RUN_IN_TREE=1', language: lang)
add_global_arguments('-DEFL_BUILD=1', language: lang)
diff --git a/src/lib/evil/evil_macro_wrapper.h b/src/lib/evil/evil_macro_wrapper.h
index ae748677b0..9eb1ac7a6e 100644
--- a/src/lib/evil/evil_macro_wrapper.h
+++ b/src/lib/evil/evil_macro_wrapper.h
@@ -46,20 +46,6 @@
#define mkdir(dirname, mode) evil_mkdir(dirname, mode)
/*
- * evil_time.h
- */
-
-/**
- * @def localtime_r(t, r)
- *
- * Wrapper around evil_localtime_r().
- */
-#ifdef localtime_r
-# undef localtime_r
-#endif
-#define localtime_r(t, r) evil_localtime_r(t, r)
-
-/*
* evil_unistd.h
*/
diff --git a/src/lib/evil/evil_time.c b/src/lib/evil/evil_time.c
index 76c5a58657..90b63692fc 100644
--- a/src/lib/evil/evil_time.c
+++ b/src/lib/evil/evil_time.c
@@ -12,16 +12,6 @@
#include "evil_macro_wrapper.h"
#include "evil_private.h"
-struct tm *
-evil_localtime_r(const time_t *timep, struct tm *result)
-{
- __time64_t t = *timep;
-
- _localtime64_s(result, &t);
-
- return result;
-}
-
/*
* strptime
* based on http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/time/strptime.c?rev=HEAD
diff --git a/src/lib/evil/evil_time.h b/src/lib/evil/evil_time.h
index 34607de5d1..00f538cae7 100644
--- a/src/lib/evil/evil_time.h
+++ b/src/lib/evil/evil_time.h
@@ -2,6 +2,9 @@
#define __EVIL_TIME_H__
+#include <time.h>
+
+
/**
* @file evil_time.h
* @brief The file that provides functions ported from Unix in time.h.
@@ -15,26 +18,6 @@
/**
- * @brief Convert the calendar time to broken-time representation in a
- * user supplied data.
- *
- * @param timep The calender time.
- * @param result The broken-down time representation.
- * @return The broken-down time representation.
- *
- * This function converts the calendar time @p timep to a broken-time
- * representation. The result is stored in the buffer @p result
- * supplied by the user. If @p timep or @p result are @c NULL, or if
- * an error occurred, this function returns @c NULL and the values in
- * @p result might be undefined. Otherwise it returns @p result.
- *
- * Conformity: Non applicable.
- *
- * Supported OS: Windows XP.
- */
-EAPI struct tm *evil_localtime_r(const time_t *timep, struct tm *result);
-
-/**
* @brief Convert a string representation of time to a time tm structure .
*
* @param buf The string to convert.