]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/engine/boehm_gc/doc/README.macros
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / tools / build / src / engine / boehm_gc / doc / README.macros
CommitLineData
7c673cae
FG
1The collector uses a large amount of conditional compilation in order to
2deal with platform dependencies. This violates a number of known coding
3standards. On the other hand, it seems to be the only practical way to
4support this many platforms without excessive code duplication.
5
6A few guidelines have mostly been followed in order to keep this manageable:
7
81) #if and #ifdef directives are properly indented whenever easily possible.
9All known C compilers allow whitespace between the "#" and the "if" to make
10this possible. ANSI C also allows white space before the "#", though we
11avoid that. It has the known disadvantages that it differs from the normal
12GNU conventions, and that it makes patches larger than otherwise necessary.
13In my opinion, it's still well worth it, for the same reason that we indent
14ordinary "if" statements.
15
162) Whenever possible, tests are performed on the macros defined in gcconfig.h
17instead of directly testing patform-specific predefined macros. This makes it
18relatively easy to adapt to new compilers with a different set of predefined
19macros. Currently these macros generally identify platforms instead of
20features. In many cases, this is a mistake.
21
22Many of the tested configuration macros are at least somewhat defined in
23either include/private/gcconfig.h or in Makefile.direct. Here is an attempt
24at defining some of the remainder: (Thanks to Walter Bright for suggesting
25this. This is a work in progress)
26
27MACRO EXPLANATION
28----- -----------
29
30__DMC__ Always #define'd by the Digital Mars compiler. Expands
31 to the compiler version number in hex, i.e. 0x810 is
32 version 8.1b0
33
34_ENABLE_ARRAYNEW
35 #define'd by the Digital Mars C++ compiler when
36 operator new[] and delete[] are separately
37 overloadable. Used in gc_cpp.h.
38
39_MSC_VER Expands to the Visual C++ compiler version. Assumed to
40 not be defined for other compilers (at least if they behave
41 appreciably differently).
42
43_DLL Defined by Visual C++ if dynamic libraries are being built
44 or used. Used to test whether __declspec(dllimport) or
45 __declspec(dllexport) needs to be added to declarations
46 to support the case in which the collector is in a dll.
47
48GC_DLL User-settable macro that forces the effect of _DLL. Set
49 by gc.h if _DLL is defined and GC_NOT_DLL is undefined.
50 This is the macro that is tested internally to determine
51 whether the GC is in its own dynamic library. May need
52 to be set by clients before including gc.h. Note that
53 inside the GC implementation it indicates that the
54 collector is in its own dynamic library, should export
55 its symbols, etc. But in clients it indicates that the
56 GC resides in a different DLL, its entry points should
57 be referenced accordingly, and precautions may need to
58 be taken to properly deal with statically allocated
59 variables in the main program. Used only for MS Windows.
60
61GC_NOT_DLL User-settable macro that overrides _DLL, e.g. if dynamic
62 libraries are used, but the collector is in a static library.
63
64__STDC__ Assumed to be defined only by compilers that understand
65 prototypes and other C89 features. Its value is generally
66 not used, since we are fine with most nonconforming extensions.
67
68SUNOS5SIGS Solaris-like signal handling. This is probably misnamed,
69 since it really doesn't guarantee much more than Posix.
70 Currently set only for Solaris2.X, HPUX, and DRSNX. Should
71 probably be set for some other platforms.
72
73PCR Set if the collector is being built as part of the Xerox
74 Portable Common Runtime.
75
76USE_COMPILER_TLS Assume the existence of __thread-style thread-local
77 storage. Set automatically for thread-local allocation with
78 the HP/UX vendor compiler. Usable with gcc on sufficiently
79 up-to-date ELF platforms.
80
81
82