From: David Reid Date: Mon, 4 Nov 2002 21:20:52 +0000 (+0000) Subject: Work around a daft mistake in the beos headers... X-Git-Tag: php-4.3.0RC1~285 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=464d8ca5c1650975e7181a42998fcf8e9d8147f3;p=php Work around a daft mistake in the beos headers... --- diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h index 2908283fae..a016d331cf 100644 --- a/main/php_reentrancy.h +++ b/main/php_reentrancy.h @@ -88,7 +88,7 @@ char *asctime_r(const struct tm *tm, char *buf); #endif -#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) +#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) || defined(__BEOS__) #define PHP_NEED_REENTRANCY 1 PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm); #else diff --git a/main/reentrancy.c b/main/reentrancy.c index 73e3b8eb8d..27e94a70a0 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -164,6 +164,18 @@ PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) #endif /* NETWARE */ +#if defined(__BEOS__) + +PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) +{ + /* Modified according to LibC definition */ + if (((struct tm*)gmtime_r(timep, p_tm)) == p_tm) + return (p_tm); + return (NULL); +} + +#endif /* BEOS */ + #if !defined(HAVE_POSIX_READDIR_R) PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry,