编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

__has_include是啥(include是什么意思)

wxchong 2024-08-18 01:02:28 开源技术 15 ℃ 0 评论

gcc的手册:4.2.12 __has_include

It may be used in #if and #elif expressions to test whether the header referenced can be included.

据说can和may不同的一个例子是:学生问老师"Can I go to the bathroom?" 老师答"Yes you can, but you may not."

The __has_include operator by itself, without any operand or parentheses, acts as a predefined macro so that support for it can be tested in portable code. Thus, the recommended use of the operator is as follows:

#if defined __has_include // 有此功能?
#  if __has_include (<a.h>) // 有此文件?
#    include <a.h>
#  endif
#endif

Makefile里可以:LVGL_PATH ?= ${shell pwd}/lvgl

?= is called a conditional variable assignment operator, because it only has an effect if the variable is not yet defined.

If you want make to simply ignore a makefile which does not exist or cannot be remade, with no error message, use the -include directive instead of include.

To ignore errors in a recipe line, write a '-' at the beginning of the line's text (after the initial tab). The '-' is discarded before the line is passed to the shell for execution.

A blank line that begins with a tab is not blank: it's an empty recipe (see Section 5.9 [Empty Recipes], page 62).

A comment in a recipe is not a make comment; it will be passed to the shell as-is. Whether the shell treats it as a comment or not depends on your shell.


Factorials can be computed at compile-time using template metaprogramming techniques,

riptutorial cplusplus example calculating-factorials.

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表