Re: cpp -dM & MAC_OS_X_VERSION_MIN_REQUIRED
Re: cpp -dM & MAC_OS_X_VERSION_MIN_REQUIRED
- Subject: Re: cpp -dM & MAC_OS_X_VERSION_MIN_REQUIRED
- From: Jim Ingham <email@hidden>
- Date: Wed, 18 May 2005 10:54:39 -0700
The MAC_OS_X_VERSION_MIN_REQUIRED was removed from the compiler
because it was considered bad to pollute the defines namespace with
not "__" prefixed defines. So now you have to explicitly include
AvailabilityMacros.h. This shouldn't be a problem, however. For tcl
it's fine to put it in tclUnixPort.h with the appropriate guards if
you need it there, or for tk in tkMacOSXPort.h.
Note, when you test versions using MAC_OS_X_VERSION_10_? you have to
be a little careful. Don't assume that MAC_OS_X_VERSION_10_? is
defined, since on earlier systems than "?" it may not be... And
since unknown preprocessor symbols default to 0, your test then won't
do what you expected it to...
Since MAC_OS_X_VERSION_* is guaranteed to be defined on all systems
>= that system, you can just do:
#if defined (MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MAX_ALLOWED
>= MAC_OS_X_VERSION_10_3
That's morally the same, and will guard against compiling in code
that won't compile if built on earlier systems. Also, don't assume
that if MAC_OS_X_VERSION_10_4 is NOT defined it means you are on
10.3, since the QT 7 SDK installs the Tiger version of
AvailabilityMacros.h, which defines MAC_OS_X_VERSION_10_4...
Jim
On May 18, 2005, at 7:16 AM, james tittle wrote:
...previously (10.3), when getting a list of preprocessor defines,
I would see:
...
#define __USER_LABEL_PREFIX__ _
#define __STDC_HOSTED__ 1
#define MAC_OS_X_VERSION_MIN_REQUIRED 1030
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __ppc__ 1
...
...I just tried this "cpp -dM /dev/null" on my 10.4 install, and
don't get a MAC_OS_X_VERSION_MIN_REQUIRED definition: is this to
be expected? If so, how should I test to see if I'm on 10.4 or
greater? Are we forced to use the AccessibilityMacros.h? I ask
because it turns out that sqrtf and friends are now defined in /usr/
local/architecture/ppc/math.h, but they weren't in >10.4...
thanx,
jamie
ps: here's what I got:
tiggity:~/puredataDev/externals/zexy/src tigital$ cpp -dM /dev/null
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 2147483647
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 0
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 0
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define __APPLE_CC__ 4061
#define __UINTMAX_TYPE__ long long unsigned int
#define __LDBL_MAX_EXP__ 1024
#define __SCHAR_MAX__ 127
#define __USER_LABEL_PREFIX__ _
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __DBL_DIG__ 15
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __ppc__ 1
#define __strong
#define __APPLE__ 1
#define __DECIMAL_DIG__ 33
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DYNAMIC__ 1
#define __GNUC__ 4
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __DBL_MAX_EXP__ 1024
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_HAS_QUIET_NAN__ 1
#define __REGISTER_PREFIX__
#define __NO_INLINE__ 1
#define _ARCH_PPC 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "4.0.0 20041026 (Apple Computer, Inc. build 4061)"
#define __BIG_ENDIAN__ 1
#define __SIZE_TYPE__ long unsigned int
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __NATURAL_ALIGNMENT__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 2147483647L
#define __FLT_HAS_INFINITY__ 1
#define _BIG_ENDIAN 1
#define __LDBL_MANT_DIG__ 106
#define __WCHAR_TYPE__ int
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define __LONG_DOUBLE_128__ 1
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __WINT_TYPE__ int
#define __LDBL_MIN_EXP__ (-968)
#define __MACH__ 1
#define __LDBL_MAX_10_EXP__ 308
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __INTMAX_MAX__ 9223372036854775807LL
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __INTMAX_TYPE__ long long int
#define __GNUC_MINOR__ 0
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __PTRDIFF_TYPE__ int
#define __LDBL_MIN_10_EXP__ (-291)
#define __LDBL_DIG__ 31
#define __POWERPC__ 1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden