本文簡要介紹ruby語言中 MakeMakefile.have_const
的用法。
用法
have_const(const, headers = nil, opt = "", &b)
返回是否定義了常量const
。您可以選擇將 const
的 type
作為 [const, type]
傳遞,例如:
have_const(%w[PTHREAD_MUTEX_INITIALIZER pthread_mutex_t], "pthread.h")
除了公共頭文件之外,您還可以傳遞額外的headers
進行檢查,並將額外的標誌傳遞給opt
,然後將其傳遞給編譯器。
如果找到,宏將作為預處理器常量傳遞給編譯器,使用類型名稱(大寫),前綴為 HAVE_CONST_
。
例如,如果 have_const('foo')
返回 true,則 HAVE_CONST_FOO
預處理器宏將被傳遞給編譯器。
相關用法
- Ruby MakeMakefile.enable_config用法及代碼示例
- Ruby MakeMakefile.convertible_int用法及代碼示例
- Ruby MakeMakefile.create_header用法及代碼示例
- Ruby MakeMakefile.with_config用法及代碼示例
- Ruby MakeMakefile.create_makefile用法及代碼示例
- Ruby MatchData.pre_match用法及代碼示例
- Ruby Matrix lup()用法及代碼示例
- Ruby Matrix unitary?()用法及代碼示例
- Ruby Matrix symmetric?()用法及代碼示例
- Ruby Matrix t()用法及代碼示例
- Ruby Matrix identity()用法及代碼示例
- Ruby Matrix hash()用法及代碼示例
- Ruby Matrix hadamard_product()用法及代碼示例
- Ruby Matrix singular?()用法及代碼示例
- Ruby Math sqrt()用法及代碼示例
- Ruby Matrix round()用法及代碼示例
- Ruby Matrix collect()用法及代碼示例
- Ruby Math.acosh用法及代碼示例
- Ruby Markdown類用法及代碼示例
- Ruby Matrix hermitian?()用法及代碼示例
- Ruby Matrix row_vectors()用法及代碼示例
- Ruby Matrix conjugate()用法及代碼示例
- Ruby Math.asinh用法及代碼示例
- Ruby Matrix cofactor()用法及代碼示例
- Ruby Matrix rectangular()用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 MakeMakefile.have_const。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。