[1/2] time_internal: Do not attempt to override *time_r() macros

Message ID 20190410084837.14574-1-martin@martin.st
State Committed
Commit 9485cce6d55baf547e92ef1f54cad117f2a38287
Headers show
Series
  • [1/2] time_internal: Do not attempt to override *time_r() macros
Related show

Commit Message

Martin Storsjö April 10, 2019, 8:48 a.m.
From: Michael Niedermayer <michaelni@gmx.at>

This allegedly fixed build on odd mingw setups, and generally
seems like a safe thing to do (in case configure failed to detect
them while they still are available in headers).
---
 libavutil/time_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/libavutil/time_internal.h b/libavutil/time_internal.h
index 829fefb007..d0597db050 100644
--- a/libavutil/time_internal.h
+++ b/libavutil/time_internal.h
@@ -22,7 +22,7 @@ 
 #include <time.h>
 #include "config.h"
 
-#if !HAVE_GMTIME_R
+#if !HAVE_GMTIME_R && !defined(gmtime_r)
 static inline struct tm *gmtime_r(const time_t* clock, struct tm *result)
 {
     struct tm *ptr = gmtime(clock);
@@ -33,7 +33,7 @@  static inline struct tm *gmtime_r(const time_t* clock, struct tm *result)
 }
 #endif
 
-#if !HAVE_LOCALTIME_R
+#if !HAVE_LOCALTIME_R && !defined(localtime_r)
 static inline struct tm *localtime_r(const time_t* clock, struct tm *result)
 {
     struct tm *ptr = localtime(clock);