Re: Omni Frameworks build problems
Re: Omni Frameworks build problems
- Subject: Re: Omni Frameworks build problems
- From: "Timothy J. Wood" <email@hidden>
- Date: Sun, 4 Aug 2002 14:51:11 -0700
On Sunday, August 4, 2002, at 11:00 AM, Hasan Diwan wrote:
>
I can't seem to get the OmniBase framework to build properly. Project
>
Builder spits out "Invalid identifier". The line highlighted is:
>
DEFINE_NSSTRING(OBAbstractImplementation);
Please search the archives. You need a newer version of
OBUtilities.h that removes a workaround for the broken cpp-precomp in
pre-Apr 2002 Dev Tools.
If you drop the attached file in your OmniBase, this problem should
go away.
We'll be releasing update source soon, probably soon after 10.2 is
released.
-tim
// Copyright 1997-2002 Omni Development, Inc. All rights reserved.
//
// This software may only be used and reproduced according to the
// terms in the file OmniSourceLicense.html, which should be
// distributed with this project and can also be found at
//
http://www.omnigroup.com/DeveloperResources/OmniSourceLicense.html.
//
// $Header: /Network/Source/CVS/OmniGroup/Frameworks/OmniBase/OBUtilities.h,v 1.24.6.2 2002/06/26 10:02:03 andrew Exp $
#import <Foundation/NSString.h>
#import <objc/objc.h>
#import <objc/objc-class.h>
#import <objc/objc-runtime.h>
#import <OmniBase/FrameworkDefines.h>
#ifndef NO_INLINE
#define INLINE inline
#else
#define INLINE
#endif // NO_INLINE
OmniBase_EXTERN void OBRequestConcreteImplementation(id self, SEL _cmd);
OmniBase_EXTERN void OBRejectUnusedImplementation(id self, SEL _cmd);
OmniBase_EXTERN NSString *OBAbstractImplementation;
OmniBase_EXTERN NSString *OBUnusedImplementation;
OmniBase_EXTERN IMP OBRegisterInstanceMethodWithSelector(Class aClass, SEL oldSelector, SEL newSelector);
/*.doc.
Provides the same functionality as +[NSObject registerInstanceMethod:withMethodTypes:forSelector: but does it without provoking +initialize on the target class. Returns the original implementation.
*/
OmniBase_EXTERN IMP OBReplaceMethodImplementation(Class aClass, SEL oldSelector, IMP newImp);
/*.doc.
Replaces the given method implementation in place. Returns the old implementation.
*/
OmniBase_EXTERN IMP OBReplaceMethodImplementationWithSelector(Class aClass, SEL oldSelector, SEL newSelector);
/*.doc.
Calls the above, but determines newImp by looking up the instance method for newSelector. Returns the old implementation.
*/
OmniBase_EXTERN IMP OBReplaceMethodImplementationWithSelectorOnClass(Class destClass, SEL oldSelector, Class sourceClass, SEL newSelector);
/*.doc.
Calls OBReplaceMethodImplementation. Derives newImp from newSelector on sourceClass and changes method implementation for oldSelector on destClass.
*/
// This returns YES if the given pointer is a class object
static INLINE BOOL OBPointerIsClass(id object)
{
if (object)
return CLS_GETINFO((struct objc_class *)(object->isa), CLS_META);
return NO;
}
// This returns the class object for the given pointer. For an instance, that means getting the class. But for a class object, that means returning the pointer itself
static INLINE Class OBClassForPointer(id object)
{
if (!object)
return object;
if (OBPointerIsClass(object))
return object;
else
return object->isa;
}
static INLINE BOOL OBClassIsSubclassOfClass(Class subClass, Class superClass)
{
while (subClass) {
if (subClass == superClass)
return YES;
else
subClass = subClass->super_class;
}
return NO;
}
// This macro ensures that we call [super initialize] in our +initialize (since this behavior is necessary for some classes in Cocoa), but it keeps custom class initialization from executing more than once.
#define OBINITIALIZE \
do { \
static BOOL hasBeenInitialized = NO; \
[super initialize]; \
if (hasBeenInitialized) \
return; \
hasBeenInitialized = YES;\
} while (0);
#if defined(__GNUC__) && (__GNUC__ < 3) && defined(__APPLE_CC__) && (__APPLE_CC__ < 937)
// The gcc 2.x version of cpp-precomp for Mach has a bug which makes us have to do this
// TJW: Also the 2.95 that comes with the Apr 2002 Dev Tools (version 937) has a fixed cpp-precomp
#define NSSTRINGIFY(name) @ ## '"' ## name ## '"'
#else
#define NSSTRINGIFY(name) @ ## #name
#endif
// An easy way to define string constants. For example, "NSSTRINGIFY(foo)" produces @"foo" and "DEFINE_NSSTRING(foo);" produces: NSString *foo = @"foo";
#define DEFINE_NSSTRING(name) \
NSString *name = NSSTRINGIFY(name)
#ifdef WIN32
// BSD stuff that NT doesn't have.
double rint(double a);
#endif
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.