1 CROSS-PLATFORM PORTABILITY GUIDELINES FOR GALLIUM3D
4 = General Considerations =
6 The state tracker and winsys driver support a rather limited number of
7 platforms. However, the pipe drivers are meant to run in a wide number of
8 platforms. Hence the pipe drivers, the auxiliary modules, and all public
9 headers in general, should stricly follow these guidelines to ensure
14 * Include the p_compiler.h.
16 * Don't use the 'inline' keyword, use the INLINE macro in p_compiler.h instead.
18 * Cast explicitly when converting to integer types of smaller sizes.
20 * Cast explicitly when converting between float, double and integral types.
22 * Don't use named struct initializers.
24 * Don't use variable number of macro arguments. Use static inline functions
30 * Avoid including standard library headers. Most standard library functions are
31 not available in Windows Kernel Mode. Use the appropriate p_*.h include.
33 == Memory Allocation ==
35 * Use MALLOC, CALLOC, FREE instead of the malloc, calloc, free functions.
37 * Use align_pointer() function defined in p_util.h for aligning pointers in a
42 * Use the functions/macros in p_debug.h.
44 * Don't include assert.h, call abort, printf, etc.