C语言中用宏来作注释

看了PostgreSQL的代码后,我觉得有不理解的地方,比如:

例如这样的:

/* Options that may appear after CATALOG (on the same line) */
#define BKI_BOOTSTRAP
#define BKI_SHARED_RELATION
#define BKI_WITHOUT_OIDS
#define BKI_ROWTYPE_OID(oid)
#define BKI_SCHEMA_MACRO
CATALOG(pg_tablespace,) BKI_SHARED_RELATION
{
NameData spcname; /* tablespace name */
Oid spcowner; /* owner of tablespace */
text spclocation; /* physical location (VAR LENGTH) */
aclitem spcacl[]; /* access permissions (VAR LENGTH) */
text spcoptions[]; /* per-tablespace options */
} FormData_pg_tablespace;

我怀疑它就是个注释的作用。所以我也实验了一把:

[pgsql@localhost tst]$ cat gao01.c
#include <stdio.h>
#include <stdlib.h> #define MAN
#define WOMAN int main(){ typedef struct MAN
{
int m_id;
int m_age;
} Human_A; typedef struct WOMAN
{
int m_id;
int m_age;
} Human_B; typedef Human_A *Human_A_ptr;
typedef Human_B *Human_B_ptr; Human_A_ptr gao01;
Human_B_ptr gao02; gao01= (Human_A_ptr) malloc( sizeof(Human_A));
gao01->m_id=;
gao01->m_age=; free(gao01); gao02 = (Human_B_ptr) malloc(sizeof(Human_B));
gao02->m_id=;
gao02->m_age=; free(gao02); return ; }
[pgsql@localhost tst]$
上一篇:微前端框架 qiankun 技术分析


下一篇:现在企业流行的java框架技术