gpt4 book ai didi

c - stdarg.h 在哪里?

转载 作者:太空狗 更新时间:2023-10-29 16:49:02 27 4
gpt4 key购买 nike

在我的系统 (Mac OS 10.6) 上 /usr/include/stdarg.h 是:

/* This file is public domain.  */
/* GCC uses its own copy of this header */
#if defined(__GNUC__)
#include_next <stdarg.h>
#elif defined(__MWERKS__)
#include "mw_stdarg.h"
#else
#error "This header only supports __MWERKS__."
#endif

那么,如果 GCC 使用它自己的 stdarg.h 副本,它在哪里?我不知道什么#include_next 意味着(也许是 GCC 扩展?),也不是关于“MWERKS”(编译器?)。

最佳答案

<stdarg.h> ,甚至比大多数 C 库头文件更多,往往是非常特定于编译器的。因此,OS X 上的每个编译器都有自己的 stdarg.h实现,位于特定于编译器的位置(作为该编译器的默认搜索路径的一部分包含在内)。编译器找到通用 stdarg.h ,这基本上告诉它“继续寻找”(通过扩展名 #include_next ),然后找到特定于编译器的实现。

__MWERKS__指的是 PPC 的旧编译器“MetroWerks CodeWarrior”。

关于c - stdarg.h 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6712493/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com