Skip to content

Commit 464d8ca

Browse files
author
David Reid
committed
Work around a daft mistake in the beos headers...
1 parent 7dd1248 commit 464d8ca

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

main/php_reentrancy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ char *asctime_r(const struct tm *tm, char *buf);
8888
#endif
8989

9090

91-
#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME)
91+
#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) || defined(__BEOS__)
9292
#define PHP_NEED_REENTRANCY 1
9393
PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm);
9494
#else

main/reentrancy.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
164164

165165
#endif /* NETWARE */
166166

167+
#if defined(__BEOS__)
168+
169+
PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
170+
{
171+
/* Modified according to LibC definition */
172+
if (((struct tm*)gmtime_r(timep, p_tm)) == p_tm)
173+
return (p_tm);
174+
return (NULL);
175+
}
176+
177+
#endif /* BEOS */
178+
167179
#if !defined(HAVE_POSIX_READDIR_R)
168180

169181
PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry,

0 commit comments

Comments
 (0)