discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3dd8fb8a5517fe9061148846c44cd9044c726b39
commit 3dd8fb8a5517fe9061148846c44cd9044c726b39 Author: Mike Blumenkrantz <[email protected]> Date: Tue Sep 23 15:51:51 2014 -0400 move eina_value_util_time_string_new() to not inline uses strptime which will cause warnings for people who don't do includes correctly --- src/lib/eina/eina_inline_value_util.x | 24 ------------------------ src/lib/eina/eina_value_util.c | 15 +++++++++++++++ src/lib/eina/eina_value_util.h | 8 ++++++++ 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/lib/eina/eina_inline_value_util.x b/src/lib/eina/eina_inline_value_util.x index e7534e7..2cb96e4 100644 --- a/src/lib/eina/eina_inline_value_util.x +++ b/src/lib/eina/eina_inline_value_util.x @@ -20,10 +20,6 @@ #ifndef EINA_INLINE_VALUE_UTIL_X_ #define EINA_INLINE_VALUE_UTIL_X_ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include <inttypes.h> #include <math.h> #include <time.h> @@ -164,26 +160,6 @@ eina_value_util_time_new(time_t t) /** * @brief Create a new #Eina_Value containing the passed parameter - * @param timestr The value to use - * @return The #Eina_Value - * @since 1.12 - */ -static inline Eina_Value * -eina_value_util_time_string_new(const char *timestr) -{ - Eina_Value *v; - struct tm tm; - time_t t; - - if (!strptime(timestr, "%Y%m%dT%H:%M:%S", &tm)) return NULL; - t = mktime(&tm); - v = eina_value_new(EINA_VALUE_TYPE_TIMESTAMP); - if (v) eina_value_set(v, t); - return v; -} - -/** - * @brief Create a new #Eina_Value containing the passed parameter * @param val The value to use * @return The #Eina_Value * @since 1.12 diff --git a/src/lib/eina/eina_value_util.c b/src/lib/eina/eina_value_util.c index 261eba2..4bfd977 100644 --- a/src/lib/eina/eina_value_util.c +++ b/src/lib/eina/eina_value_util.c @@ -23,6 +23,7 @@ #include "eina_safety_checks.h" #include "eina_value.h" #include "eina_stringshare.h" +#include <time.h> typedef struct _Eina_Value_Util_Struct_Desc @@ -78,3 +79,17 @@ eina_value_util_struct_desc_new(void) st_desc->base.ops = &operations; return (Eina_Value_Struct_Desc*)st_desc; } + +EAPI Eina_Value * +eina_value_util_time_string_new(const char *timestr) +{ + Eina_Value *v; + struct tm tm; + time_t t; + + if (!strptime(timestr, "%Y%m%dT%H:%M:%S", &tm)) return NULL; + t = mktime(&tm); + v = eina_value_new(EINA_VALUE_TYPE_TIMESTAMP); + if (v) eina_value_set(v, t); + return v; +} diff --git a/src/lib/eina/eina_value_util.h b/src/lib/eina/eina_value_util.h index b4022a5..8bc8330 100644 --- a/src/lib/eina/eina_value_util.h +++ b/src/lib/eina/eina_value_util.h @@ -35,6 +35,14 @@ */ EAPI Eina_Value_Struct_Desc *eina_value_util_struct_desc_new(void); +/** + * @brief Create a new #Eina_Value containing the passed parameter + * @param timestr The value to use + * @return The #Eina_Value + * @since 1.12 + */ +EAPI Eina_Value *eina_value_util_time_string_new(const char *timestr); + #include "eina_inline_value_util.x" /** --
