Cgiccソース分析:CgiDefs.h
cgiccはC++のcgiライブラリです.
このヘッダファイルには、主にプラットフォームに関するマクロ定義が定義されています.
#if HAVE_CONFIG_H
# include "config.h"
#endif
私のバージョンにはconfigがあります.hこの書類.内容:主要是一些配置信息,是在编译时生成的。Cgicc这个类里面提供了一些API用来获取这些信息,感觉没什么实际用处。
/* 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"
# define CGICC_USE_NAMESPACES 1
# define CGICC_API
この2つのマクロは他のファイルで多く使われているので、注意してください.CGICC_APIが空で、LINUX版の多くのクラスが定義される前にそれがあれば、無視すれば目が覚めます.
#if CGICC_USE_NAMESPACES
# define CGICC_BEGIN_NAMESPACE namespace cgicc {
# define CGICC_END_NAMESPACE }
# define CGICCNS cgicc::
# define STDNS std::
その他の一般的なマクロ.感覚の主な役割はやはり明らかな標識のためだ.論理構造をより明確にする.