try to integerate Riccardo's inttypes patch

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37313 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2013-10-29 09:14:45 +00:00
parent 540e4523b8
commit e22078004e
8 changed files with 55 additions and 31 deletions

View file

@ -1,3 +1,15 @@
2012-10-29 Riccardo Mottola <rm@gnu.org>
* configure.ac:
* Headers/GNUstepBase/GSConfig.h.in:
* Headers/GNUstepBase/GSTypeEncoding.h:
* Headers/GNUstepBase/GNUstep.h:
* Headers/Foundation/NSString.h:
* Headers/Foundation/NSObjCRuntime.h:
* configure: regenerate
Use inttypes.h rather than stdint.h as it's more inclusive and works
on Solaris where some defines are in the wrong place.
2013-10-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTimeZone.m: Implement -hash as the hash of the time zone

View file

@ -35,15 +35,14 @@
#endif
#endif
#include <stdarg.h>
#include <stdint.h>
#include <limits.h>
#include <float.h>
#import <GNUstepBase/GSVersionMacros.h>
#import <GNUstepBase/GSConfig.h>
#import <GNUstepBase/GSBlocks.h>
#include <stdarg.h>
#include <limits.h>
#include <float.h>
/* These typedefs must be in place before GSObjCRuntime.h is imported.
*/

View file

@ -274,7 +274,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
+ (id) stringWithCString: (const char*)byteString
length: (NSUInteger)length;
+ (id) stringWithCString: (const char*)byteString;
+ (id) stringWithFormat: (NSString*)format,... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithContentsOfFile:(NSString *)path;
// Initializing Newly Allocated Strings
@ -361,7 +361,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
range: (NSRange)aRange;
// Combining Strings
- (NSString*) stringByAppendingFormat: (NSString*)format,...
- (NSString*) stringByAppendingFormat: (NSString*)format, ...
NS_FORMAT_FUNCTION(1,2);
- (NSString*) stringByAppendingString: (NSString*)aString;
@ -750,7 +750,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
+ (id) stringWithContentsOfURL: (NSURL*)url;
+ (id) stringWithUTF8String: (const char*)bytes;
- (id) initWithFormat: (NSString*)format
locale: (NSDictionary*)locale, ... NS_FORMAT_FUNCTION(1,3);
locale: (NSDictionary*)locale, ... NS_FORMAT_FUNCTION(1,3);
- (id) initWithFormat: (NSString*)format
locale: (NSDictionary*)locale
arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0);
@ -833,7 +833,7 @@ typedef NSUInteger NSStringEncodingConversionOptions;
+ (id) stringWithCString: (const char*)byteString
length: (NSUInteger)length;
+ (id) stringWithCString: (const char*)byteString;
+ (id) stringWithFormat: (NSString*)format,... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2);
+ (id) stringWithContentsOfFile: (NSString*)path;
+ (NSMutableString*) stringWithCapacity: (NSUInteger)capacity;

View file

@ -25,6 +25,20 @@
#ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_
#define __GNUSTEP_GNUSTEP_H_INCLUDED_
/* Solaris < 10 kludge. */
#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
# if defined(__arch64__) || defined (__x86_64__)
# define PRIuPTR "lu"
# define PRIxPTR "lx"
# define PRIdPTR "ld"
# else
# define PRIuPTR "u"
# define PRIxPTR "x"
# define PRIdPTR "d"
# endif
#endif
/* The contents of this file are designed to be usable with either
* GNUstep-base or MacOS-X Foundation.
*/

View file

@ -184,7 +184,7 @@ typedef gsuaddr gsaddr;
/*
* Ensure some standard types are defined.
*/
@INCLUDE_STDINT@
@INCLUDE_INTTYPES@
@DEFINE_INT8_T@
@DEFINE_UINT8_T@
@DEFINE_INT16_T@
@ -381,9 +381,7 @@ typedef struct {
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#endif
// Strong has different semantics in GC and ARC modes, so we need to have a

View file

@ -27,7 +27,8 @@
#ifndef GS_TYPE_ENCODING_H
#define GS_TYPE_ENCODING_H
#include <stdint.h>
#import <GNUstepBase/GSVersionMacros.h>
#import <GNUstepBase/GSConfig.h>
#if defined (NeXT_RUNTIME)
# include <objc/objc-runtime.h>

18
configure vendored
View file

@ -682,7 +682,7 @@ DEFINE_UINT16_T
DEFINE_INT16_T
DEFINE_UINT8_T
DEFINE_INT8_T
INCLUDE_STDINT
INCLUDE_INTTYPES
HAVE_PTS_STREAM_MODULES
OBJCFLAGS
HAVE_OBJC_SYNC_ENTER
@ -19638,18 +19638,18 @@ fi
done
if test $ac_cv_header_stdint_h = yes; then
INCLUDE_STDINT="#include <stdint.h>"
elif test $ac_cv_header_inttypes_h = yes; then
INCLUDE_STDINT="#include <inttypes.h>"
if test $ac_cv_header_inttypes_h = yes; then
INCLUDE_INTTYPES="#include <inttypes.h>"
elif test $ac_cv_header_sys_inttypes_h = yes; then
INCLUDE_STDINT="#include <sys/inttypes.h>"
INCLUDE_INTTYPES="#include <sys/inttypes.h>"
elif test $ac_cv_header_stdint_h = yes; then
INCLUDE_INTTYPES="#include <stdint.h>"
else
INCLUDE_STDINT="no"
INCLUDE_INTTYPES="no"
fi
if test "$INCLUDE_STDINT" = "no"; then
INCLUDE_STDINT=""
if test "$INCLUDE_INTTYPES" = "no"; then
INCLUDE_INTTYPES=""
DEFINE_INT8_T="#define int8_t gss8"
DEFINE_UINT8_T="#define uint8_t gsu8"
DEFINE_INT16_T="#define int16_t gss16"

View file

@ -2298,18 +2298,18 @@ AC_CHECK_HEADERS(dnl
stdlib.h dnl
)
if test $ac_cv_header_stdint_h = yes; then
INCLUDE_STDINT="#include <stdint.h>"
elif test $ac_cv_header_inttypes_h = yes; then
INCLUDE_STDINT="#include <inttypes.h>"
if test $ac_cv_header_inttypes_h = yes; then
INCLUDE_INTTYPES="#include <inttypes.h>"
elif test $ac_cv_header_sys_inttypes_h = yes; then
INCLUDE_STDINT="#include <sys/inttypes.h>"
INCLUDE_INTTYPES="#include <sys/inttypes.h>"
elif test $ac_cv_header_stdint_h = yes; then
INCLUDE_INTTYPES="#include <stdint.h>"
else
INCLUDE_STDINT="no"
INCLUDE_INTTYPES="no"
fi
if test "$INCLUDE_STDINT" = "no"; then
INCLUDE_STDINT=""
if test "$INCLUDE_INTTYPES" = "no"; then
INCLUDE_INTTYPES=""
DEFINE_INT8_T="#define int8_t gss8"
DEFINE_UINT8_T="#define uint8_t gsu8"
DEFINE_INT16_T="#define int16_t gss16"
@ -2333,7 +2333,7 @@ DEFINE_INTPTR_T=""
DEFINE_UINTPTR_T=""
fi
AC_SUBST(INCLUDE_STDINT)
AC_SUBST(INCLUDE_INTTYPES)
AC_SUBST(DEFINE_INT8_T)
AC_SUBST(DEFINE_UINT8_T)
AC_SUBST(DEFINE_INT16_T)