mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Header fixups for MacOSX
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15864 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c6559096e0
commit
9d78b79dce
14 changed files with 125 additions and 35 deletions
|
@ -25,9 +25,13 @@
|
|||
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSRange.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <gnustep/base/GSObjCRuntime.h>
|
||||
#include <gnustep/base/GCObject.h>
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <gnustep/base/GSObjCRuntime.h>
|
||||
#include <gnustep/base/GCObject.h>
|
||||
|
|
|
@ -28,10 +28,14 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <gnustep/base/GCObject.h>
|
||||
#include "GSCompatibility.h"
|
||||
|
|
|
@ -143,13 +143,13 @@ typedef enum _NSGNUstepStringEncoding
|
|||
NSBIG5StringEncoding // Traditional chinese
|
||||
} NSGNUstepStringEncoding;
|
||||
|
||||
@interface NSObject(GNUStepGlue)
|
||||
@interface NSObject(GSCompatibility)
|
||||
+ (id) notImplemented:(SEL)selector;
|
||||
- (BOOL) isInstance;
|
||||
@end
|
||||
|
||||
// Used only in EOFault.m, -[EOFault forward::], for Object compatibility
|
||||
@interface NSInvocation(GNUStepGlue)
|
||||
@interface NSInvocation(GSCompatibility)
|
||||
- (retval_t) returnFrame:(arglist_t)args;
|
||||
- (id) initWithArgframe:(arglist_t)args selector:(SEL)selector;
|
||||
@end
|
||||
|
@ -157,12 +157,12 @@ typedef enum _NSGNUstepStringEncoding
|
|||
GS_EXPORT NSArray *NSStandardLibraryPaths();
|
||||
GS_EXPORT NSString *GetEncodingName(NSStringEncoding availableEncodingValue);
|
||||
|
||||
@interface NSString(GNUStepGlue)
|
||||
@interface NSString(GSCompatibility)
|
||||
- (BOOL) boolValue;
|
||||
@end
|
||||
|
||||
GS_EXPORT BOOL GSDebugSet(NSString *level);
|
||||
@interface NSProcessInfo(GNUStepGlue)
|
||||
@interface NSProcessInfo(GSCompatibility)
|
||||
- (NSMutableSet *) debugSet;
|
||||
@end
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "config.h"
|
||||
#include <objc/objc-class.h>
|
||||
#include "GSCompatibility.h"
|
||||
#include "GSCategories.h"
|
||||
|
||||
/* FIXME: Need to initialize this */
|
||||
NSRecursiveLock *gnustep_global_lock = NULL;
|
||||
|
@ -107,7 +108,7 @@ GSDebugFunctionMsg(const char *func, const char *file, int line, NSString *fmt)
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSProcessInfo(GNUStepGlue)
|
||||
@implementation NSProcessInfo(GSCompatibility)
|
||||
|
||||
static NSMutableSet *_debug_set = nil;
|
||||
|
||||
|
@ -157,7 +158,7 @@ BOOL GSDebugSet(NSString *level)
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSString(GNUStepGlue)
|
||||
@implementation NSString(GSCompatibility)
|
||||
|
||||
// From GNUStep
|
||||
/**
|
||||
|
@ -180,7 +181,7 @@ BOOL GSDebugSet(NSString *level)
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSInvocation(GNUStepGlue)
|
||||
@implementation NSInvocation(GSCompatibility)
|
||||
- (retval_t) returnFrame:(arglist_t)args
|
||||
{
|
||||
#warning (stephane@sente.ch) Not implemented
|
||||
|
@ -195,11 +196,10 @@ BOOL GSDebugSet(NSString *level)
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSObject(GNUStepGlue)
|
||||
@implementation NSObject(GSCompatibility)
|
||||
|
||||
+ (id) notImplemented:(SEL)selector
|
||||
{
|
||||
#warning (stephane@sente.ch) Not implemented
|
||||
[NSException raise: NSGenericException
|
||||
format: @"method %s not implemented in %s(class)",
|
||||
selector ? sel_get_name(selector) : "(null)",
|
||||
|
@ -214,4 +214,3 @@ selector ? sel_get_name(selector) : "(null)",
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <base/preface.h>
|
||||
#include <gnustep/base/preface.h>
|
||||
#ifndef ROUND
|
||||
#define ROUND(V, A) \
|
||||
({ typeof(V) __v=(V); typeof(A) __a=(A); \
|
||||
|
@ -113,7 +113,17 @@ objc_sizeof_type(const char* type)
|
|||
while (*type != _C_STRUCT_E)
|
||||
{
|
||||
align = objc_alignof_type (type); /* padd to alignment */
|
||||
#if 0
|
||||
acc_size = ROUND (acc_size, align);
|
||||
#else
|
||||
// acc_size = ({int __v=(acc_size); int __a=(align); __a*((__v+__a-1)/__a); });
|
||||
{
|
||||
int __v = acc_size;
|
||||
int __a = align;
|
||||
|
||||
acc_size = __a * ((__v + __a - 1) / __a);
|
||||
}
|
||||
#endif
|
||||
acc_size += objc_sizeof_type (type); /* add component size */
|
||||
type = objc_skip_typespec (type); /* skip component */
|
||||
}
|
||||
|
@ -243,7 +253,15 @@ objc_aligned_size (const char* type)
|
|||
{
|
||||
int size = objc_sizeof_type (type);
|
||||
int align = objc_alignof_type (type);
|
||||
#if 0
|
||||
return ROUND (size, align);
|
||||
#else
|
||||
// return ({int __v=(size); int __a=(align); __a*((__v+__a-1)/__a); });
|
||||
int __v = size;
|
||||
int __a = align;
|
||||
|
||||
return __a * ((__v + __a - 1) / __a);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -257,7 +275,15 @@ objc_promoted_size (const char* type)
|
|||
int size = objc_sizeof_type (type);
|
||||
int wordsize = sizeof (void*);
|
||||
|
||||
#if 0
|
||||
return ROUND (size, wordsize);
|
||||
#else
|
||||
// return ({int __v=(size); int __a=(wordsize); __a*((__v+__a-1)/__a); });
|
||||
int __v = size;
|
||||
int __a = wordsize;
|
||||
|
||||
return __a * ((__v + __a - 1) / __a);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <base/preface.h>
|
||||
#include <gnustep/base/preface.h>
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
|
@ -38,7 +39,10 @@
|
|||
#include <Foundation/NSObjCRuntime.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <base/GSObjCRuntime.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
#include <gnustep/base/GSObjCRuntime.h>
|
||||
#include <string.h>
|
||||
|
||||
/** Deprecated ... use GSObjCFindVariable() */
|
||||
|
@ -632,8 +636,12 @@ GSObjCAddClassBehavior(Class receiver, Class behavior)
|
|||
|
||||
|
||||
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSKeyValueCoding.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
/** Deprecated ... use GSObjCGetValue() */
|
||||
id
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#ifdef HAVE_LIBXML
|
||||
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/GSXML.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
|
@ -54,6 +55,9 @@
|
|||
#include <Foundation/NSCharacterSet.h>
|
||||
#include <Foundation/NSFileManager.h>
|
||||
#include <Foundation/NSInvocation.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
/* libxml headers */
|
||||
#include <libxml/tree.h>
|
||||
|
@ -3237,10 +3241,14 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
|
||||
#else
|
||||
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSObjCRuntime.h>
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <Foundation/NSInvocation.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Build dummy implementations of the classes if libxml is not available
|
||||
|
|
|
@ -28,14 +28,18 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSPathUtilities.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
#include "GSCompatibility.h"
|
||||
#include <base/Unicode.h>
|
||||
#include <gnustep/base/Unicode.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -602,12 +606,15 @@ GSEncodingName(NSStringEncoding encoding)
|
|||
/**
|
||||
* <strong>deprecated</strong> Use GSEncodingName()
|
||||
*/
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
NSString*
|
||||
GetEncodingName(NSStringEncoding encoding)
|
||||
{
|
||||
return GSEncodingName(encoding);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
static const char *
|
||||
iconv_stringforencoding(NSStringEncoding encoding)
|
||||
{
|
||||
|
@ -617,6 +624,7 @@ iconv_stringforencoding(NSStringEncoding encoding)
|
|||
}
|
||||
return encodingTable[encoding]->iconv;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
|
|
|
@ -50,10 +50,14 @@
|
|||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <base/preface.h>
|
||||
#include <base/behavior.h>
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <gnustep/base/behavior.h>
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
static BOOL class_is_kind_of(Class self, Class class);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue