help-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAssert and noescape?


From: Aaron Hillegass
Subject: NSAssert and noescape?
Date: Mon, 5 Feb 2018 13:47:28 -0500

Hi,

I’m porting the FMDB library to run on GNUstep on Linux:
https://github.com/ccgus/fmdb

I’m getting errors with the vargs on NSAssert:
FMDatabase.m:1495:36: error: too many arguments provided to function-like macro invocation
            NSAssert(false, @"%@", [self lastErrorMessage]);
                                   ^
/usr/local/include/Foundation/NSException.h:475:9: note: macro 'NSAssert' defined here
#define NSAssert(condition, desc)                      

I’m also getting some warnings on noescape:
./FMDatabasePool.h:199:36: warning: unknown attribute 'noescape' ignored [-Wunknown-attributes]
- (void)inDatabase:(__attribute__((noescape)) void (^)(FMDatabase *db))block;

I’d appreciate any help I can get.

- Aaron

P.S.

Trivia for other who will come after me: I had to install libbsd and libdispatch. As a dumb work-around, I also defined some empty macros:

#ifdef __linux__
    #define SInt32 int32_t
    #define NS_SWIFT_NAME(the_name)
    #define __deprecated_msg(the_message)
#endif

Here’s how I’m building it:
clang -x objective-c -fconstant-string-class=NSConstantString -fPIC -fobjc-nonfragile-abi -fblocks  -I/usr/local/include/ -c FMDatabase.m -o FMDatabase.o

Clang details:
$ clang --version
clang version 4.0.1-6 (tags/RELEASE_401/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]