cgicc是一個C++的cgi庫。
這個頭文件里主要定義了一些平臺相關(guān)的宏定義。
#if HAVE_CONFIG_H
# include "config.h"
#endif
我的版本里有config.h這個文件。內(nèi)容:
/* Name of package. */
#define PACKAGE "cgicc"
/* Version of package. */
#define VERSION "3.2"
/* System cgicc was configured for */
#define HOST "i686-pc-linux-gnu"
/* Whether to enable debug logging */
#define DEBUG 0
/* Define if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define if you have the `uname' function. */
#define HAVE_UNAME 1
/* Name of package */
#define PACKAGE "cgicc"
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Version number of package */
#define VERSION "3.2"
主要是一些配置信息,是在編譯時生成的。Cgicc這個類里面提供了一些API用來獲取這些信息,感覺沒什么實際用處。
WIN32那快略去,只看LINUX部分的。
# define CGICC_USE_NAMESPACES 1
# define CGICC_API
這兩個宏在其他文件里用的很多,所以要注意一下,CGICC_API為空,LINUX版的很多類定義前都
有它,只要忽略它就醒了。
#if CGICC_USE_NAMESPACES
# define CGICC_BEGIN_NAMESPACE namespace cgicc {
# define CGICC_END_NAMESPACE }
# define CGICCNS cgicc::
# define STDNS std::
其他常用的宏。感覺主要的作用還是為了一種明顯的標示。使邏輯結(jié)構(gòu)更清楚一些。