Merge commit 'origin/gallium-0.1' into gallium-0.1
[mesa.git] / src / gallium / README.portability
1 CROSS-PLATFORM PORTABILITY GUIDELINES FOR GALLIUM3D
2
3
4 = General Considerations =
5
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
10
11
12 = Compiler Support =
13
14 * Include the p_compiler.h.
15
16 * Don't use the 'inline' keyword, use the INLINE macro in p_compiler.h instead.
17
18 * Cast explicitly when converting to integer types of smaller sizes.
19
20 * Cast explicitly when converting between float, double and integral types.
21
22 * Don't use named struct initializers.
23
24 * Don't use variable number of macro arguments. Use static inline functions
25 instead.
26
27
28 = Standard Library =
29
30 * Avoid including standard library headers. Most standard library functions are
31 not available in Windows Kernel Mode. Use the appropriate p_*.h include.
32
33 == Memory Allocation ==
34
35 * Use MALLOC, CALLOC, FREE instead of the malloc, calloc, free functions.
36
37 * Use align_pointer() function defined in p_util.h for aligning pointers in a
38 portable way.
39
40 == Debugging ==
41
42 TODO
43