nginx 來源碼頭檔案包含為什麼是 < >, 而不是" "
巴扎黑
巴扎黑 2017-05-16 17:18:11
0
1
360

在看nginx 原始碼是看到頭檔包含都是使用#include <ngx_core.h> #include <nginx.h> 類似格式, 在IDE 中會錯誤找不到檔案
這些檔案不是在系統目錄裡,為什麼要使用"<>"

巴扎黑
巴扎黑

全部回覆(1)
巴扎黑

以下節選自ISO/IEC 9899:1999原文:

# include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the < and > delimiters, and causes the replacement of that directive by the entire contents of the header.

How the places are specified or the header identified is implementation-defined.

注意到最後了嗎,implementation-defined——沒人規定說就是系統目​​錄,而且很多編譯器的預設行為也不是只找系統目錄。即使是同一種編譯器,具體的行為尚且可能取決於你提供的選項呢,何況C語言編譯器五花八門。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!