今天在AIX平台使用xlC编译XQilla的时候发现一个显示调用template类型的析构函数语句无法通过,前两天也遇到过l类似的问题,发现在这条语句之前有定义在VC里面是怎么调用的。 于是用VC的调用语句试一下发现能过,那么问题就转换为找到xlC编译器的预定义宏,让他编译的时候使用和VC一样的语句就行了。Google了一会, 发现一个巨好的网站,收集了n多预定义宏。下面隆重推出本文的主角:
Pre-defined C/C++ Compiler Macros
http://predef.sourceforge.net/index.php
在这个网站中,根据库,编译器,操作系统,构架 收集了各种各样的宏。 真是考虑跨平台移植程序的利器。
下面拷贝xlc的宏定义作为留念,参考.
IBM XL C/C++
Type | Macro | Format | Description |
---|---|---|---|
Identification | __xlc__ | . | Compiles C |
Identification | __xlC__ | . | Compiles C++ |
Version | __xlc__ __xlC__ | 0xVVRR | VV = Version RR = Revision |
Identification | __IBMC__ | . | From ? |
Identification | __IBMCPP__ | . | From ? |
Version | __IBMC__ __IBMCPP__ | VRP | V = Version R = Revision P = Patch |
Please note that the z/OS C/C++ compiler also defines __IBMC__
and __IBMCPP__
macros, but with a different syntax. See the entry on the z/OS C/C++ compiler below for further information.
Example
IBM XL C/C++ | __xlC__ | __IBMCPP__ |
---|---|---|
3.1 | 0x0301 | . |
4.5 | 0x0405 | 450 |
5.0 | 0x0500 | 500 |