The attached diff cleans up the BlocksRuntime/ directory of compiler- rt for better portability, eliminates compiler warnings, and adds support to the cmake build to install the results. More specifically, the changes: 1) Remove cmake-specific #define usage from the exported Block.h/ Block_private.h headers, since clients won't know what to set. These are moved into runtime.c as appropriate 2) Use cmake checks for CAS builtins, instead of guessing based on GCC #defines (which aren't set by clang and llvm-gcc anyway) 3) "#pragma mark" isn't supported by FSF gcc, so "#if 0" it out. It should still show up in IDEs that support it 4) Fix some compiler warnings. GCC 4.3.3 seems super strict about %p. function pointers can't be cast to void * either. 5) Avoid a warning for apple_versioning.c that "ISO C does not allow empty files" Tested on Ubuntu Linux 9.04 with clang and llvm-gcc and -fblocks to define and copy some blocks (and invoke them, obviously). Also tested on Mac OS X 10.6 and linking against -lBlocksRuntime ahead of -lSystem. -------------- next part -------------- A non-text attachment was scrubbed... Name: blocks-linux.diff Type: application/octet-stream Size: 10483 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090918/ebbb7903/attachment.obj> -------------- next part -------------- Shantonu Sen ssen at apple.com Sent from my Mac Pro
Le 18 sept. 2009 à 20:14, Shantonu Sen a écrit :> The attached diff cleans up the BlocksRuntime/ directory of compiler- > rt for better portability, eliminates compiler warnings, and adds > support to the cmake build to install the results. > > More specifically, the changes: > 1) Remove cmake-specific #define usage from the exported Block.h/ > Block_private.h headers, since clients won't know what to set. These > are moved into runtime.c as appropriate > 2) Use cmake checks for CAS builtins, instead of guessing based on > GCC #defines (which aren't set by clang and llvm-gcc anyway) > 3) "#pragma mark" isn't supported by FSF gcc, so "#if 0" it out. It > should still show up in IDEs that support itFWIW, Xcode supports the following syntax instead of pragma mark: // MARK: Your Label or // MARK:- to create a separator. If there is no other IDE that uses this pragma, it may be cleaner to replace them by this equivalent syntax.> 4) Fix some compiler warnings. GCC 4.3.3 seems super strict about > %p. function pointers can't be cast to void * either. > 5) Avoid a warning for apple_versioning.c that "ISO C does not allow > empty files" > > Tested on Ubuntu Linux 9.04 with clang and llvm-gcc and -fblocks to > define and copy some blocks (and invoke them, obviously). Also > tested on Mac OS X 10.6 and linking against -lBlocksRuntime ahead of > -lSystem. > > <blocks-linux.diff> > Shantonu Sen > ssen at apple.com > > Sent from my Mac Pro-- Jean-Daniel
Possibly Parallel Threads
- [LLVMdev] [llvm-commits] [PATCH] BlocksRuntime updates for Linux
- [LLVMdev] [llvm-commits] [PATCH] BlocksRuntime updates for Linux
- [LLVMdev] [llvm-commits] [PATCH] BlocksRuntime updates for Linux
- [LLVMdev] [llvm-commits] [PATCH] BlocksRuntime updates for Linux
- [LLVMdev] [llvm-commits] [PATCH] BlocksRuntime updates for Linux