Possible poor use of __ppc__, __ppc64__ and __i386__ in CFRuntime.h
Possible poor use of __ppc__, __ppc64__ and __i386__ in CFRuntime.h
- Subject: Possible poor use of __ppc__, __ppc64__ and __i386__ in CFRuntime.h
- From: Shawn Erickson <email@hidden>
- Date: Mon, 21 Nov 2005 12:41:59 -0800
I was poking around in Core Foundation for unrelated reasons and came
across the following code in CFRuntime.h [1] in the 10.4.3 version of
things (CF-368.18).
typedef struct __CFRuntimeBase {
void *_isa;
#if defined(__ppc__) || defined(__ppc64__)
uint16_t _rc;
uint16_t _info;
#elif defined(__i386__)
uint16_t _info;
uint16_t _rc;
#else
#error unknown architecture
#endif
} CFRuntimeBase;
#if defined(__ppc__) || defined(__ppc64__)
#define INIT_CFRUNTIME_BASE(isa, info, rc) { isa, info, rc }
#elif defined(__i386__)
#define INIT_CFRUNTIME_BASE(isa, info, rc) { isa, rc, info }
#else
#error unknown architecture
#endif
It looks like an endian specific compile time check... if so I believe
it is better to check for __BIG_ENDIAN__ (and possibly also
__LITTLE_ENDIAN__) in the above instead of checking processor type
macros. If others agree I will file a defect.
-Shawn
[1] <http://darwinsource.opendarwin.org/10.4.3/CF-368.18/Base.subproj/CFRuntime.h>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden