UNIX编程中的通用头文件与时间处理
1. 通用头文件 defs.h
在编程中,我们常常会用到通用头文件 defs.h 。它包含了对 SUV_SUS2 的请求以及对 suvreq.h 的包含,同时还有许多常用的标准包含项。即使程序不需要所有这些额外的包含项,我们也无需担心。对于不常用的头文件,我们会根据需要进行包含。以下是 defs.h 的大部分内容:
#if defined(FREEBSD) || defined(DARWIN)
#define BSD_DERIVED
#endif
#if !defined(BSD_DERIVED) /* _POSIX_SOURCE too restrictive */
#define SUV_SUS2
#include "suvreq.h"
#endif
#ifdef __GNUC__
#define _GNU_SOURCE /* bring GNU as close to C99 as possible */
#endif
#include <unistd.h>
#ifndef __cplusplus
#include <stdbool.h> /* C99 only */
#endif
#include <sys/types.h>
#include <time.h>
#include <limits.h>
#ifdef SOLARIS
#define _VA_LIST /* can't define it in stdio.h */
超级会员免费看
订阅专栏 解锁全文
9万+

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



