mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Use dedicated code for glibc specific variant of strerror_r based on
an autoconf test instead of trying to tweak feature test macros to use the POSIX version. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35774 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
52bc22f8be
commit
9877c8af3a
8 changed files with 5443 additions and 20777 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2012-11-02 Wolfgang Lux <wlux@uni-muenster.de>
|
||||||
|
|
||||||
|
* configure.ac: Use AC_FUNC_STRERROR_R to check for presence and
|
||||||
|
version of the strerror_r function.
|
||||||
|
* Source/Additions/NSError+GNUstepBase.m (-_systemError:): Add
|
||||||
|
conditional code for glibc specific version of strerror_r.
|
||||||
|
* Source/common.h: No longer redefine feature test macros as this
|
||||||
|
could invalidate the autoconf results.
|
||||||
|
|
||||||
|
* configure:
|
||||||
|
* Headers/GNUstepBase/config.h.in:
|
||||||
|
* SSL/configure:
|
||||||
|
* SSL/config.h.in: Regenerated by autoreconf.
|
||||||
|
|
||||||
2012-10-30 Richard Frith-Macdonald <rfm@gnu.org>
|
2012-10-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/Additions/NSError+GNUstepBase.m:
|
* Source/Additions/NSError+GNUstepBase.m:
|
||||||
|
|
|
@ -198,6 +198,10 @@
|
||||||
/* Define to 1 if you have the `ctime' function. */
|
/* Define to 1 if you have the `ctime' function. */
|
||||||
#undef HAVE_CTIME
|
#undef HAVE_CTIME
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#undef HAVE_DECL_STRERROR_R
|
||||||
|
|
||||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||||
*/
|
*/
|
||||||
#undef HAVE_DIRENT_H
|
#undef HAVE_DIRENT_H
|
||||||
|
@ -750,6 +754,9 @@
|
||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#undef PACKAGE_TARNAME
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the home page for this package. */
|
||||||
|
#undef PACKAGE_URL
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
@ -789,6 +796,9 @@
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define to 1 if strerror_r returns char *. */
|
||||||
|
#undef STRERROR_R_CHAR_P
|
||||||
|
|
||||||
/* Define if the compiler provides builtins for atomic operations */
|
/* Define if the compiler provides builtins for atomic operations */
|
||||||
#undef USE_ATOMIC_BUILTINS
|
#undef USE_ATOMIC_BUILTINS
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,9 @@
|
||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#undef PACKAGE_TARNAME
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the home page for this package. */
|
||||||
|
#undef PACKAGE_URL
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
|
4965
SSL/configure
vendored
4965
SSL/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -128,17 +128,31 @@ strerror_r(int eno, char *buf, int len)
|
||||||
#else
|
#else
|
||||||
NSString *message;
|
NSString *message;
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
# if STRERROR_R_CHAR_P
|
||||||
|
char *result;
|
||||||
|
# else
|
||||||
int result;
|
int result;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* FIXME ... not all are POSIX, should we use NSMachErrorDomain for some? */
|
/* FIXME ... not all are POSIX, should we use NSMachErrorDomain for some? */
|
||||||
domain = NSPOSIXErrorDomain;
|
domain = NSPOSIXErrorDomain;
|
||||||
result = strerror_r(code, buf, BUFSIZ);
|
result = strerror_r(code, buf, BUFSIZ);
|
||||||
|
# if STRERROR_R_CHAR_P
|
||||||
|
if (result == 0)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf), "%ld", code);
|
||||||
|
result = buf;
|
||||||
|
}
|
||||||
|
message = [NSString stringWithCString: result
|
||||||
|
encoding: [NSString defaultCStringEncoding]];
|
||||||
|
# else
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%ld", code);
|
snprintf(buf, sizeof(buf), "%ld", code);
|
||||||
}
|
}
|
||||||
message = [NSString stringWithCString: buf
|
message = [NSString stringWithCString: buf
|
||||||
encoding: [NSString defaultCStringEncoding]];
|
encoding: [NSString defaultCStringEncoding]];
|
||||||
|
# endif
|
||||||
/* FIXME ... can we do better localisation? */
|
/* FIXME ... can we do better localisation? */
|
||||||
info = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
info = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||||
message, NSLocalizedDescriptionKey,
|
message, NSLocalizedDescriptionKey,
|
||||||
|
|
|
@ -6,40 +6,6 @@
|
||||||
|
|
||||||
#import "config.h"
|
#import "config.h"
|
||||||
|
|
||||||
/* Disable extensions (config.h may have turned them on) ...
|
|
||||||
* we want to use standard code.
|
|
||||||
*/
|
|
||||||
#if defined(_GNU_SOURCE)
|
|
||||||
# undef _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Ensure we have _XOPEN_SOURCE turned on at the appropriate
|
|
||||||
* level for the facilities we need.
|
|
||||||
*
|
|
||||||
* Minimum of 600 for string.h so we get the POSIX strerror_r() behavior
|
|
||||||
* on systems using glibc.
|
|
||||||
*
|
|
||||||
* Any systems where using XOPEN causes problems can define GSXOPEN to 0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
|
||||||
# define GSXOPEN 0
|
|
||||||
#else
|
|
||||||
# define GSXOPEN 600
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if GSXOPEN > 0
|
|
||||||
# if defined(_XOPEN_SOURCE)
|
|
||||||
# if _XOPEN_SOURCE < GSXOPEN
|
|
||||||
# undef _XOPEN_SOURCE
|
|
||||||
# define _XOPEN_SOURCE GSXOPEN
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define _XOPEN_SOURCE GSXOPEN
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_STRING_H)
|
#if defined(HAVE_STRING_H)
|
||||||
/* For POSIX strerror_r() and others
|
/* For POSIX strerror_r() and others
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2341,7 +2341,8 @@ AC_CHECK_FUNCS(setrlimit)
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# One of these functions needed by NSDebug.m and NSProcessInfo.m
|
# One of these functions needed by NSDebug.m and NSProcessInfo.m
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
AC_CHECK_FUNCS(strerror_r strerror)
|
AC_CHECK_FUNCS(strerror)
|
||||||
|
AC_FUNC_STRERROR_R
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Needed by NSDebug.m
|
# Needed by NSDebug.m
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue