From d33ff301454fa1db9919674dbc2a37309bbd529f Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 30 Jan 2003 05:22:52 +0000 Subject: Portability fix for glob.h building in FreeBSD ports system. Implement a fix for bug # 2169: too many OSs, even major OSs like Solaris, don't properly implement SA_RESTART: important system calls like stat() can still fail when SA_RESTART is set. So, forget the BROKEN_RESTART config check and get rid of atomic_stat() and atomic_readdir(), and implement permanent wrappers for EINTR checking on various system calls (stat(), fstat(), opendir(), and readdir() so far). --- glob/ChangeLog | 6 ++++++ glob/glob.h | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'glob') diff --git a/glob/ChangeLog b/glob/ChangeLog index 1ebf879..75c6888 100644 --- a/glob/ChangeLog +++ b/glob/ChangeLog @@ -1,3 +1,9 @@ +2003-01-30 Paul D. Smith + + * glob.h: Patch for FreeBSD by Mike Barcroft + Reported by Gerald Pfeifer . On + FreeBSD, declare __size_t to simply size_t. + 2002-04-22 Paul D. Smith * Makefile.am: Use automake 1.6. diff --git a/glob/glob.h b/glob/glob.h index 9f735fe..ca523f7 100644 --- a/glob/glob.h +++ b/glob/glob.h @@ -47,9 +47,12 @@ extern "C" { /* We need `size_t' for the following definitions. */ #ifndef __size_t -# if defined __GNUC__ && __GNUC__ >= 2 -typedef __SIZE_TYPE__ __size_t; +# if defined __FreeBSD__ +# define __size_t size_t # else +# if defined __GNUC__ && __GNUC__ >= 2 +typedef __SIZE_TYPE__ __size_t; +# else /* This is a guess. */ /*hb * Conflicts with DECCs aready defined type __size_t. @@ -57,9 +60,10 @@ typedef __SIZE_TYPE__ __size_t; * Anyway if DECC is used and __SIZE_T is defined then __size_t is * already defined (and I hope it's exactly the one we need here). */ -#if !(defined __DECC && defined __SIZE_T) +# if !(defined __DECC && defined __SIZE_T) typedef unsigned long int __size_t; -#endif +# endif +# endif # endif #else /* The GNU CC stddef.h version defines __size_t as empty. We need a real -- cgit v1.2.3