equal
deleted
inserted
replaced
|
1 .. -*- coding: utf-8; -*- |
|
2 |
|
3 ======================= |
|
4 cpp (C preprocessor). |
|
5 ======================= |
|
6 |
|
7 How to see macros expansion? |
|
8 ============================ |
|
9 |
|
10 GCC:: |
|
11 |
|
12 $ cpp <file>.c |
|
13 |
|
14 MSVC:: |
|
15 |
|
16 $ cl /E <file>.c |
|
17 |
|
18 Who to see predefined macros? |
|
19 ============================= |
|
20 |
|
21 See: |
|
22 |
|
23 http://predef.sourceforge.net/ |
|
24 http://en.wikipedia.org/wiki/C_preprocessor#Compiler-specific_predefined_macros |
|
25 |
|
26 GNU C Compiler:: |
|
27 |
|
28 $ gcc -dM -E - < /dev/null |
|
29 |
|
30 HP-UX ansi C compiler:: |
|
31 |
|
32 $ cc -v EMPTY.c |
|
33 |
|
34 SCO OpenServer C compiler:: |
|
35 |
|
36 $ cc -## EMPTY.c |
|
37 |
|
38 Sun Studio C/C++ compiler:: |
|
39 |
|
40 $ cc -## EMPTY.c |
|
41 |
|
42 IBM AIX XL C/C++ compiler:: |
|
43 |
|
44 $ cc -qshowmacros -E EMPTY.c |
|
45 |
|
46 For Visual Studio compiler there no any possibility get predefined macros from |
|
47 command line... |
|
48 |
|
49 http://msdn.microsoft.com/en-us/library/b0084kay.aspx |
|
50 Predefined Macros |
|
51 |