Sat 28 May 2011 02:59:37 PM UTC, comment #1:
Carbon header files for higher level interface (like MacTypes.h)
can include AvailabilityMacros.h automatically if it is available.
But inclusion of higher level interfaces by ftconfig.h makes the
namespace polluted broadly. For example, "Byte" type is defined
by MacTypes.h and cannot be used by ftraster module.
Checking C89 and POSIX.1 (1988) header files in Mac OS X,
I found 2 files useful to distinguish the earliest systems
without AvailabilityMacros.h and the later systems with it.
1) locale.h (C89 header)
_LC_LAST, the macro to indicate the number of locale dependent
properties is changed from 6 (Mac OS X 10.0-10.1) to 7
(10.2-), because LC_MESSAGES was introduced since 10.2.
2) errno.h (POSIX.1 header)
The number of predefined errors are changed from 88 (10.0-10.1),
89 (10.2), 93 (10.3), 102 (10.4), 103 (10.5-6).
Maybe the namespace pollution by errno.h (of course, only on
Mac OS X) would be more acceptable than locale.h, because
locale related header of poorly internationalized system is
sometimes hijacked by external locale libraries.
Attached file is a patch to conditionalize AvailabilityMacros.h
inclusion by errno.h.
(file #23458)
|