libev的安装
1、./configure--prefix=/usr //指定安装路径,若不指定,会默认安装到/usr/local
2、make
3、make install
__GNUC__是linux内置的一个宏
用于在跨平台编程时识别linux
有时候编译时__GNUC__不能识别,可以在makefile里显示把宏开启-D__GNUC__ 编译通过。
#ifdef __cplusplus
extern "C " {
#endif
…………
…………
#ifdef __cplusplus
}
#endif
在CPP文件中让编译器以c语言编译就要用这个宏
如果编译起在编译cpp文件那么__cplusplus 就会被定义 如果是一个c文件在被编译那么__STDC__就会被定义
Predefined Macros
The translator predefines several macro names.
The macro __DATE__ expands to a string literal that gives the date you invoked the translator. Its format is "Mmm dd yyyy ". The month name Mmm is the same as for dates generated by the library function asctime. The day part dd ranges from " 1 " to "31 " (a leading 0 becomes a space).
The macro __FILE__ expands to a string literal that gives the remembered filename of the current source file. You can alter the remembered filename by writing a line directive.
The macro __LINE__ expands to a decimal integer constant that gives the remembered line number within the current source file. You can alter the remembered line number by writing a line directive.
The macro __STDC__ expands to the decimal integer constant 1. The translator should provide another value (or leave the macro undefined) when you invoke it for other than a Standard C environment. For example, you can write:
#if __STDC__ != 1
#error NOT a Standard C environment
#endif
The macro __STDC_VERSION__ expands to the decimal integer constant 199409L. The translator should provide another value (or leave the macro undefined) when you invoke it for other than a Standard C environment that incorporates Amendment 1.
The macro __TIME__ expands to a string literal that gives the time you invoked the translator. Its format is "hh:mm:ss ", which is the same as for times generated by the library function asctime
本文详细介绍了libev的安装过程,包括配置、编译和安装步骤,并解释了__GNUC__、__cplusplus宏的作用以及预定义宏的功能。
1778

被折叠的 条评论
为什么被折叠?



