Archive for category code
Detecting GCC vs. Clang/LLVM
Posted by cordney* in code, development on September 18, 2011
The crux of the matter is that Clang also defines the __GNUC__ macros, which took me an hour or so to debug. So if you need a GCC vs. Clang (vs. LLVM-GCC) switch, you _must_ check for Clang/LLVM first.
#if defined __clang__ /* The Clang frontend to LLVM (Clang) */
#define COMPILER "Clang"
#elif defined __llvm__ /* The GCC frontend to LLVM (LLVM-GCC) */
#define COMPILER "LLVM-GCC"
#elif defined __GNUC__ /* The GNU GCC compiler */
#define COMPILER "GCC"
#else
#define COMPILER "Unknown"
#endif
Note: Code is public domain, use it freely.
samplecode: [Cocoa] Fullscreen Toolbar
This is the Fullscreen Toolbar I have written for Q. The version for Q is slightly modified to work with the host-cocoa part [see in svn: http://www.kju-app.org/proj/browser/trunk/host-cocoa/FSControls].
This code is public domain. Feel free to use, modify and redistribute it.