xcodebuild-helper 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +20 -0
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +110 -0
- data/Guardfile +18 -0
- data/README.md +7 -0
- data/Rakefile +7 -0
- data/TODO.md +3 -0
- data/bin/oclint +5 -0
- data/bin/oclint-0.8 +5 -0
- data/bin/oclint-json-compilation-database +5 -0
- data/bin/oclint-xcodebuild +5 -0
- data/externals/oclint/LICENSE +69 -0
- data/externals/oclint/bin/oclint +0 -0
- data/externals/oclint/bin/oclint-0.10.2 +0 -0
- data/externals/oclint/bin/oclint-json-compilation-database +88 -0
- data/externals/oclint/bin/oclint-xcodebuild +218 -0
- data/externals/oclint/lib/clang/3.7.0/asan_blacklist.txt +13 -0
- data/externals/oclint/lib/clang/3.7.0/include/Intrin.h +958 -0
- data/externals/oclint/lib/clang/3.7.0/include/__stddef_max_align_t.h +43 -0
- data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_aes.h +72 -0
- data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_pclmul.h +34 -0
- data/externals/oclint/lib/clang/3.7.0/include/adxintrin.h +88 -0
- data/externals/oclint/lib/clang/3.7.0/include/altivec.h +13528 -0
- data/externals/oclint/lib/clang/3.7.0/include/ammintrin.h +215 -0
- data/externals/oclint/lib/clang/3.7.0/include/arm_acle.h +304 -0
- data/externals/oclint/lib/clang/3.7.0/include/arm_neon.h +68419 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx2intrin.h +1256 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512bwintrin.h +1250 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512cdintrin.h +131 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512dqintrin.h +242 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512erintrin.h +285 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512fintrin.h +2457 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512vlbwintrin.h +1907 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512vldqintrin.h +353 -0
- data/externals/oclint/lib/clang/3.7.0/include/avx512vlintrin.h +1982 -0
- data/externals/oclint/lib/clang/3.7.0/include/avxintrin.h +1308 -0
- data/externals/oclint/lib/clang/3.7.0/include/bmi2intrin.h +99 -0
- data/externals/oclint/lib/clang/3.7.0/include/bmiintrin.h +153 -0
- data/externals/oclint/lib/clang/3.7.0/include/cpuid.h +209 -0
- data/externals/oclint/lib/clang/3.7.0/include/cuda_builtin_vars.h +110 -0
- data/externals/oclint/lib/clang/3.7.0/include/emmintrin.h +1480 -0
- data/externals/oclint/lib/clang/3.7.0/include/f16cintrin.h +63 -0
- data/externals/oclint/lib/clang/3.7.0/include/float.h +124 -0
- data/externals/oclint/lib/clang/3.7.0/include/fma4intrin.h +236 -0
- data/externals/oclint/lib/clang/3.7.0/include/fmaintrin.h +234 -0
- data/externals/oclint/lib/clang/3.7.0/include/fxsrintrin.h +55 -0
- data/externals/oclint/lib/clang/3.7.0/include/htmintrin.h +226 -0
- data/externals/oclint/lib/clang/3.7.0/include/htmxlintrin.h +363 -0
- data/externals/oclint/lib/clang/3.7.0/include/ia32intrin.h +101 -0
- data/externals/oclint/lib/clang/3.7.0/include/immintrin.h +203 -0
- data/externals/oclint/lib/clang/3.7.0/include/inttypes.h +102 -0
- data/externals/oclint/lib/clang/3.7.0/include/iso646.h +43 -0
- data/externals/oclint/lib/clang/3.7.0/include/limits.h +118 -0
- data/externals/oclint/lib/clang/3.7.0/include/lzcntintrin.h +72 -0
- data/externals/oclint/lib/clang/3.7.0/include/mm3dnow.h +167 -0
- data/externals/oclint/lib/clang/3.7.0/include/mm_malloc.h +75 -0
- data/externals/oclint/lib/clang/3.7.0/include/mmintrin.h +507 -0
- data/externals/oclint/lib/clang/3.7.0/include/module.modulemap +196 -0
- data/externals/oclint/lib/clang/3.7.0/include/nmmintrin.h +35 -0
- data/externals/oclint/lib/clang/3.7.0/include/pmmintrin.h +122 -0
- data/externals/oclint/lib/clang/3.7.0/include/popcntintrin.h +50 -0
- data/externals/oclint/lib/clang/3.7.0/include/prfchwintrin.h +39 -0
- data/externals/oclint/lib/clang/3.7.0/include/rdseedintrin.h +59 -0
- data/externals/oclint/lib/clang/3.7.0/include/rtmintrin.h +59 -0
- data/externals/oclint/lib/clang/3.7.0/include/s390intrin.h +39 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/allocator_interface.h +66 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/asan_interface.h +155 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h +118 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/coverage_interface.h +63 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h +114 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h +3070 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/lsan_interface.h +84 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/msan_interface.h +107 -0
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h +222 -0
- data/externals/oclint/lib/clang/3.7.0/include/shaintrin.h +79 -0
- data/externals/oclint/lib/clang/3.7.0/include/smmintrin.h +487 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdalign.h +35 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdarg.h +52 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdatomic.h +190 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdbool.h +44 -0
- data/externals/oclint/lib/clang/3.7.0/include/stddef.h +137 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdint.h +707 -0
- data/externals/oclint/lib/clang/3.7.0/include/stdnoreturn.h +30 -0
- data/externals/oclint/lib/clang/3.7.0/include/tbmintrin.h +154 -0
- data/externals/oclint/lib/clang/3.7.0/include/tgmath.h +1374 -0
- data/externals/oclint/lib/clang/3.7.0/include/tmmintrin.h +230 -0
- data/externals/oclint/lib/clang/3.7.0/include/unwind.h +282 -0
- data/externals/oclint/lib/clang/3.7.0/include/vadefs.h +65 -0
- data/externals/oclint/lib/clang/3.7.0/include/varargs.h +26 -0
- data/externals/oclint/lib/clang/3.7.0/include/vecintrin.h +8946 -0
- data/externals/oclint/lib/clang/3.7.0/include/wmmintrin.h +42 -0
- data/externals/oclint/lib/clang/3.7.0/include/x86intrin.h +81 -0
- data/externals/oclint/lib/clang/3.7.0/include/xmmintrin.h +1008 -0
- data/externals/oclint/lib/clang/3.7.0/include/xopintrin.h +809 -0
- data/externals/oclint/lib/clang/3.7.0/include/xtestintrin.h +41 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-i386.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-x86_64.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.profile_osx.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.safestack_osx.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libHTMLReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libJSONReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libPMDReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libTextReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libXMLReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libXcodeReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidBranchingStatementAsLastInLoopRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidDefaultArgumentsOnVirtualMethodsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidPrivateStaticMembersRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBaseClassDestructorShouldBeVirtualOrProtectedRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBitwiseOperatorInConditionalRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBrokenNullCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBrokenOddnessCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCollapsibleIfStatementsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libConstantConditionalOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libConstantIfExpressionRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCoveredSwitchStatementsDontNeedDefaultRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCyclomaticComplexityRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDeadCodeRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDefaultLabelNotLastInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDestructorOfVirtualClassRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDoubleNegativeRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyCatchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyDoWhileStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyElseBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyFinallyStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyForStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyIfStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptySwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyTryStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyWhileStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libForLoopShouldBeWhileLoopRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libGotoStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libInvertedLogicRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libJumbledIncrementerRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongClassRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongLineRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongMethodRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongVariableNameRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMisplacedNullCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMissingBreakInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMultipleUnaryOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNPathComplexityRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNcssMethodCountRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNestedBlockDepthRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNonCaseLabelInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCAssignIvarOutsideAccessorsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCBoxedExpressionsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCContainerLiteralsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCNSNumberLiteralsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCObjectSubscriptingRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyIsEqualHashRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyMustCallSuperRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyProhibitedCallRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyProtectedMethodRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifySubclassMustImplementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libParameterReassignmentRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libPreferEarlyExitRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantConditionalOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantIfStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantLocalVariableRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantNilCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libReturnFromFinallyBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libShortVariableNameRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libSwitchStatementsShouldHaveDefaultRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libThrowExceptionFromFinallyBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooFewBranchesInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyFieldsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyMethodsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyParametersRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnnecessaryElseStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnnecessaryNullCheckForCXXDeallocRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnusedLocalVariableRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnusedMethodParameterRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUselessParenthesesRule.dylib +0 -0
- data/lib/coverage_plan.rb +19 -0
- data/lib/device.rb +27 -0
- data/lib/execute.rb +7 -0
- data/lib/lint_plan.rb +41 -0
- data/lib/rules.rb +23 -0
- data/lib/test_plan.rb +11 -0
- data/lib/version.rb +3 -0
- data/lib/xcode.rb +128 -0
- data/lib/xcodebuild-helper.rb +110 -0
- data/spec/coverage_plan_spec.rb +18 -0
- data/spec/device_spec.rb +24 -0
- data/spec/lint_plan_spec.rb +35 -0
- data/spec/rule_spec.rb +37 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/test_plan_spec.rb +11 -0
- data/spec/xcode_dsl_actions_spec.rb +136 -0
- data/spec/xcode_dsl_spec.rb +176 -0
- data/spec/xcode_spec.rb +79 -0
- data/xcodebuild-helper.gemspec +26 -0
- metadata +327 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
/*===---- stdalign.h - Standard header for alignment ------------------------===
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
* THE SOFTWARE.
|
20
|
+
*
|
21
|
+
*===-----------------------------------------------------------------------===
|
22
|
+
*/
|
23
|
+
|
24
|
+
#ifndef __STDALIGN_H
|
25
|
+
#define __STDALIGN_H
|
26
|
+
|
27
|
+
#ifndef __cplusplus
|
28
|
+
#define alignas _Alignas
|
29
|
+
#define alignof _Alignof
|
30
|
+
#endif
|
31
|
+
|
32
|
+
#define __alignas_is_defined 1
|
33
|
+
#define __alignof_is_defined 1
|
34
|
+
|
35
|
+
#endif /* __STDALIGN_H */
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/*===---- stdarg.h - Variable argument handling ----------------------------===
|
2
|
+
*
|
3
|
+
* Copyright (c) 2008 Eli Friedman
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
10
|
+
* furnished to do so, subject to the following conditions:
|
11
|
+
*
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
13
|
+
* all copies or substantial portions of the Software.
|
14
|
+
*
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
* THE SOFTWARE.
|
22
|
+
*
|
23
|
+
*===-----------------------------------------------------------------------===
|
24
|
+
*/
|
25
|
+
|
26
|
+
#ifndef __STDARG_H
|
27
|
+
#define __STDARG_H
|
28
|
+
|
29
|
+
#ifndef _VA_LIST
|
30
|
+
typedef __builtin_va_list va_list;
|
31
|
+
#define _VA_LIST
|
32
|
+
#endif
|
33
|
+
#define va_start(ap, param) __builtin_va_start(ap, param)
|
34
|
+
#define va_end(ap) __builtin_va_end(ap)
|
35
|
+
#define va_arg(ap, type) __builtin_va_arg(ap, type)
|
36
|
+
|
37
|
+
/* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
|
38
|
+
* or -ansi is not specified, since it was not part of C90.
|
39
|
+
*/
|
40
|
+
#define __va_copy(d,s) __builtin_va_copy(d,s)
|
41
|
+
|
42
|
+
#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__)
|
43
|
+
#define va_copy(dest, src) __builtin_va_copy(dest, src)
|
44
|
+
#endif
|
45
|
+
|
46
|
+
/* Hack required to make standard headers work, at least on Ubuntu */
|
47
|
+
#ifndef __GNUC_VA_LIST
|
48
|
+
#define __GNUC_VA_LIST 1
|
49
|
+
#endif
|
50
|
+
typedef __builtin_va_list __gnuc_va_list;
|
51
|
+
|
52
|
+
#endif /* __STDARG_H */
|
@@ -0,0 +1,190 @@
|
|
1
|
+
/*===---- stdatomic.h - Standard header for atomic types and operations -----===
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to deal
|
5
|
+
* in the Software without restriction, including without limitation the rights
|
6
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
* copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
* THE SOFTWARE.
|
20
|
+
*
|
21
|
+
*===-----------------------------------------------------------------------===
|
22
|
+
*/
|
23
|
+
|
24
|
+
#ifndef __CLANG_STDATOMIC_H
|
25
|
+
#define __CLANG_STDATOMIC_H
|
26
|
+
|
27
|
+
/* If we're hosted, fall back to the system's stdatomic.h. FreeBSD, for
|
28
|
+
* example, already has a Clang-compatible stdatomic.h header.
|
29
|
+
*/
|
30
|
+
#if __STDC_HOSTED__ && __has_include_next(<stdatomic.h>)
|
31
|
+
# include_next <stdatomic.h>
|
32
|
+
#else
|
33
|
+
|
34
|
+
#include <stddef.h>
|
35
|
+
#include <stdint.h>
|
36
|
+
|
37
|
+
#ifdef __cplusplus
|
38
|
+
extern "C" {
|
39
|
+
#endif
|
40
|
+
|
41
|
+
/* 7.17.1 Introduction */
|
42
|
+
|
43
|
+
#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
|
44
|
+
#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
|
45
|
+
#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
|
46
|
+
#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
|
47
|
+
#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
|
48
|
+
#define ATOMIC_SHORT_T_LOCK_FREE __GCC_ATOMIC_SHORT_T_LOCK_FREE
|
49
|
+
#define ATOMIC_INT_T_LOCK_FREE __GCC_ATOMIC_INT_T_LOCK_FREE
|
50
|
+
#define ATOMIC_LONG_T_LOCK_FREE __GCC_ATOMIC_LONG_T_LOCK_FREE
|
51
|
+
#define ATOMIC_LLONG_T_LOCK_FREE __GCC_ATOMIC_LLONG_T_LOCK_FREE
|
52
|
+
#define ATOMIC_POINTER_T_LOCK_FREE __GCC_ATOMIC_POINTER_T_LOCK_FREE
|
53
|
+
|
54
|
+
/* 7.17.2 Initialization */
|
55
|
+
|
56
|
+
#define ATOMIC_VAR_INIT(value) (value)
|
57
|
+
#define atomic_init __c11_atomic_init
|
58
|
+
|
59
|
+
/* 7.17.3 Order and consistency */
|
60
|
+
|
61
|
+
typedef enum memory_order {
|
62
|
+
memory_order_relaxed = __ATOMIC_RELAXED,
|
63
|
+
memory_order_consume = __ATOMIC_CONSUME,
|
64
|
+
memory_order_acquire = __ATOMIC_ACQUIRE,
|
65
|
+
memory_order_release = __ATOMIC_RELEASE,
|
66
|
+
memory_order_acq_rel = __ATOMIC_ACQ_REL,
|
67
|
+
memory_order_seq_cst = __ATOMIC_SEQ_CST
|
68
|
+
} memory_order;
|
69
|
+
|
70
|
+
#define kill_dependency(y) (y)
|
71
|
+
|
72
|
+
/* 7.17.4 Fences */
|
73
|
+
|
74
|
+
/* These should be provided by the libc implementation. */
|
75
|
+
void atomic_thread_fence(memory_order);
|
76
|
+
void atomic_signal_fence(memory_order);
|
77
|
+
|
78
|
+
#define atomic_thread_fence(order) __c11_atomic_thread_fence(order)
|
79
|
+
#define atomic_signal_fence(order) __c11_atomic_signal_fence(order)
|
80
|
+
|
81
|
+
/* 7.17.5 Lock-free property */
|
82
|
+
|
83
|
+
#define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj)))
|
84
|
+
|
85
|
+
/* 7.17.6 Atomic integer types */
|
86
|
+
|
87
|
+
#ifdef __cplusplus
|
88
|
+
typedef _Atomic(bool) atomic_bool;
|
89
|
+
#else
|
90
|
+
typedef _Atomic(_Bool) atomic_bool;
|
91
|
+
#endif
|
92
|
+
typedef _Atomic(char) atomic_char;
|
93
|
+
typedef _Atomic(signed char) atomic_schar;
|
94
|
+
typedef _Atomic(unsigned char) atomic_uchar;
|
95
|
+
typedef _Atomic(short) atomic_short;
|
96
|
+
typedef _Atomic(unsigned short) atomic_ushort;
|
97
|
+
typedef _Atomic(int) atomic_int;
|
98
|
+
typedef _Atomic(unsigned int) atomic_uint;
|
99
|
+
typedef _Atomic(long) atomic_long;
|
100
|
+
typedef _Atomic(unsigned long) atomic_ulong;
|
101
|
+
typedef _Atomic(long long) atomic_llong;
|
102
|
+
typedef _Atomic(unsigned long long) atomic_ullong;
|
103
|
+
typedef _Atomic(uint_least16_t) atomic_char16_t;
|
104
|
+
typedef _Atomic(uint_least32_t) atomic_char32_t;
|
105
|
+
typedef _Atomic(wchar_t) atomic_wchar_t;
|
106
|
+
typedef _Atomic(int_least8_t) atomic_int_least8_t;
|
107
|
+
typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
|
108
|
+
typedef _Atomic(int_least16_t) atomic_int_least16_t;
|
109
|
+
typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
|
110
|
+
typedef _Atomic(int_least32_t) atomic_int_least32_t;
|
111
|
+
typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
|
112
|
+
typedef _Atomic(int_least64_t) atomic_int_least64_t;
|
113
|
+
typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
|
114
|
+
typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
|
115
|
+
typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
|
116
|
+
typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
|
117
|
+
typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
|
118
|
+
typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
|
119
|
+
typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
|
120
|
+
typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
|
121
|
+
typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
|
122
|
+
typedef _Atomic(intptr_t) atomic_intptr_t;
|
123
|
+
typedef _Atomic(uintptr_t) atomic_uintptr_t;
|
124
|
+
typedef _Atomic(size_t) atomic_size_t;
|
125
|
+
typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
|
126
|
+
typedef _Atomic(intmax_t) atomic_intmax_t;
|
127
|
+
typedef _Atomic(uintmax_t) atomic_uintmax_t;
|
128
|
+
|
129
|
+
/* 7.17.7 Operations on atomic types */
|
130
|
+
|
131
|
+
#define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST)
|
132
|
+
#define atomic_store_explicit __c11_atomic_store
|
133
|
+
|
134
|
+
#define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST)
|
135
|
+
#define atomic_load_explicit __c11_atomic_load
|
136
|
+
|
137
|
+
#define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST)
|
138
|
+
#define atomic_exchange_explicit __c11_atomic_exchange
|
139
|
+
|
140
|
+
#define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
|
141
|
+
#define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
|
142
|
+
|
143
|
+
#define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
|
144
|
+
#define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak
|
145
|
+
|
146
|
+
#define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
|
147
|
+
#define atomic_fetch_add_explicit __c11_atomic_fetch_add
|
148
|
+
|
149
|
+
#define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
|
150
|
+
#define atomic_fetch_sub_explicit __c11_atomic_fetch_sub
|
151
|
+
|
152
|
+
#define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
|
153
|
+
#define atomic_fetch_or_explicit __c11_atomic_fetch_or
|
154
|
+
|
155
|
+
#define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
|
156
|
+
#define atomic_fetch_xor_explicit __c11_atomic_fetch_xor
|
157
|
+
|
158
|
+
#define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
|
159
|
+
#define atomic_fetch_and_explicit __c11_atomic_fetch_and
|
160
|
+
|
161
|
+
/* 7.17.8 Atomic flag type and operations */
|
162
|
+
|
163
|
+
typedef struct atomic_flag { atomic_bool _Value; } atomic_flag;
|
164
|
+
|
165
|
+
#define ATOMIC_FLAG_INIT { 0 }
|
166
|
+
|
167
|
+
/* These should be provided by the libc implementation. */
|
168
|
+
#ifdef __cplusplus
|
169
|
+
bool atomic_flag_test_and_set(volatile atomic_flag *);
|
170
|
+
bool atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order);
|
171
|
+
#else
|
172
|
+
_Bool atomic_flag_test_and_set(volatile atomic_flag *);
|
173
|
+
_Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *, memory_order);
|
174
|
+
#endif
|
175
|
+
void atomic_flag_clear(volatile atomic_flag *);
|
176
|
+
void atomic_flag_clear_explicit(volatile atomic_flag *, memory_order);
|
177
|
+
|
178
|
+
#define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST)
|
179
|
+
#define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order)
|
180
|
+
|
181
|
+
#define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST)
|
182
|
+
#define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order)
|
183
|
+
|
184
|
+
#ifdef __cplusplus
|
185
|
+
}
|
186
|
+
#endif
|
187
|
+
|
188
|
+
#endif /* __STDC_HOSTED__ */
|
189
|
+
#endif /* __CLANG_STDATOMIC_H */
|
190
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/*===---- stdbool.h - Standard header for booleans -------------------------===
|
2
|
+
*
|
3
|
+
* Copyright (c) 2008 Eli Friedman
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
10
|
+
* furnished to do so, subject to the following conditions:
|
11
|
+
*
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
13
|
+
* all copies or substantial portions of the Software.
|
14
|
+
*
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
* THE SOFTWARE.
|
22
|
+
*
|
23
|
+
*===-----------------------------------------------------------------------===
|
24
|
+
*/
|
25
|
+
|
26
|
+
#ifndef __STDBOOL_H
|
27
|
+
#define __STDBOOL_H
|
28
|
+
|
29
|
+
/* Don't define bool, true, and false in C++, except as a GNU extension. */
|
30
|
+
#ifndef __cplusplus
|
31
|
+
#define bool _Bool
|
32
|
+
#define true 1
|
33
|
+
#define false 0
|
34
|
+
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
35
|
+
/* Define _Bool, bool, false, true as a GNU extension. */
|
36
|
+
#define _Bool bool
|
37
|
+
#define bool bool
|
38
|
+
#define false false
|
39
|
+
#define true true
|
40
|
+
#endif
|
41
|
+
|
42
|
+
#define __bool_true_false_are_defined 1
|
43
|
+
|
44
|
+
#endif /* __STDBOOL_H */
|
@@ -0,0 +1,137 @@
|
|
1
|
+
/*===---- stddef.h - Basic type definitions --------------------------------===
|
2
|
+
*
|
3
|
+
* Copyright (c) 2008 Eli Friedman
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
10
|
+
* furnished to do so, subject to the following conditions:
|
11
|
+
*
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
13
|
+
* all copies or substantial portions of the Software.
|
14
|
+
*
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
* THE SOFTWARE.
|
22
|
+
*
|
23
|
+
*===-----------------------------------------------------------------------===
|
24
|
+
*/
|
25
|
+
|
26
|
+
#if !defined(__STDDEF_H) || defined(__need_ptrdiff_t) || \
|
27
|
+
defined(__need_size_t) || defined(__need_wchar_t) || \
|
28
|
+
defined(__need_NULL) || defined(__need_wint_t)
|
29
|
+
|
30
|
+
#if !defined(__need_ptrdiff_t) && !defined(__need_size_t) && \
|
31
|
+
!defined(__need_wchar_t) && !defined(__need_NULL) && \
|
32
|
+
!defined(__need_wint_t)
|
33
|
+
/* Always define miscellaneous pieces when modules are available. */
|
34
|
+
#if !__has_feature(modules)
|
35
|
+
#define __STDDEF_H
|
36
|
+
#endif
|
37
|
+
#define __need_ptrdiff_t
|
38
|
+
#define __need_size_t
|
39
|
+
#define __need_wchar_t
|
40
|
+
#define __need_NULL
|
41
|
+
#define __need_STDDEF_H_misc
|
42
|
+
/* __need_wint_t is intentionally not defined here. */
|
43
|
+
#endif
|
44
|
+
|
45
|
+
#if defined(__need_ptrdiff_t)
|
46
|
+
#if !defined(_PTRDIFF_T) || __has_feature(modules)
|
47
|
+
/* Always define ptrdiff_t when modules are available. */
|
48
|
+
#if !__has_feature(modules)
|
49
|
+
#define _PTRDIFF_T
|
50
|
+
#endif
|
51
|
+
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
52
|
+
#endif
|
53
|
+
#undef __need_ptrdiff_t
|
54
|
+
#endif /* defined(__need_ptrdiff_t) */
|
55
|
+
|
56
|
+
#if defined(__need_size_t)
|
57
|
+
#if !defined(_SIZE_T) || __has_feature(modules)
|
58
|
+
/* Always define size_t when modules are available. */
|
59
|
+
#if !__has_feature(modules)
|
60
|
+
#define _SIZE_T
|
61
|
+
#endif
|
62
|
+
typedef __SIZE_TYPE__ size_t;
|
63
|
+
#endif
|
64
|
+
#undef __need_size_t
|
65
|
+
#endif /*defined(__need_size_t) */
|
66
|
+
|
67
|
+
#if defined(__need_STDDEF_H_misc)
|
68
|
+
/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
|
69
|
+
* enabled. */
|
70
|
+
#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \
|
71
|
+
!defined(_RSIZE_T)) || __has_feature(modules)
|
72
|
+
/* Always define rsize_t when modules are available. */
|
73
|
+
#if !__has_feature(modules)
|
74
|
+
#define _RSIZE_T
|
75
|
+
#endif
|
76
|
+
typedef __SIZE_TYPE__ rsize_t;
|
77
|
+
#endif
|
78
|
+
#endif /* defined(__need_STDDEF_H_misc) */
|
79
|
+
|
80
|
+
#if defined(__need_wchar_t)
|
81
|
+
#ifndef __cplusplus
|
82
|
+
/* Always define wchar_t when modules are available. */
|
83
|
+
#if !defined(_WCHAR_T) || __has_feature(modules)
|
84
|
+
#if !__has_feature(modules)
|
85
|
+
#define _WCHAR_T
|
86
|
+
#if defined(_MSC_EXTENSIONS)
|
87
|
+
#define _WCHAR_T_DEFINED
|
88
|
+
#endif
|
89
|
+
#endif
|
90
|
+
typedef __WCHAR_TYPE__ wchar_t;
|
91
|
+
#endif
|
92
|
+
#endif
|
93
|
+
#undef __need_wchar_t
|
94
|
+
#endif /* defined(__need_wchar_t) */
|
95
|
+
|
96
|
+
#if defined(__need_NULL)
|
97
|
+
#undef NULL
|
98
|
+
#ifdef __cplusplus
|
99
|
+
# if !defined(__MINGW32__) && !defined(_MSC_VER)
|
100
|
+
# define NULL __null
|
101
|
+
# else
|
102
|
+
# define NULL 0
|
103
|
+
# endif
|
104
|
+
#else
|
105
|
+
# define NULL ((void*)0)
|
106
|
+
#endif
|
107
|
+
#ifdef __cplusplus
|
108
|
+
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
|
109
|
+
namespace std { typedef decltype(nullptr) nullptr_t; }
|
110
|
+
using ::std::nullptr_t;
|
111
|
+
#endif
|
112
|
+
#endif
|
113
|
+
#undef __need_NULL
|
114
|
+
#endif /* defined(__need_NULL) */
|
115
|
+
|
116
|
+
#if defined(__need_STDDEF_H_misc)
|
117
|
+
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
|
118
|
+
#include "__stddef_max_align_t.h"
|
119
|
+
#endif
|
120
|
+
#define offsetof(t, d) __builtin_offsetof(t, d)
|
121
|
+
#undef __need_STDDEF_H_misc
|
122
|
+
#endif /* defined(__need_STDDEF_H_misc) */
|
123
|
+
|
124
|
+
/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
|
125
|
+
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
|
126
|
+
#if defined(__need_wint_t)
|
127
|
+
/* Always define wint_t when modules are available. */
|
128
|
+
#if !defined(_WINT_T) || __has_feature(modules)
|
129
|
+
#if !__has_feature(modules)
|
130
|
+
#define _WINT_T
|
131
|
+
#endif
|
132
|
+
typedef __WINT_TYPE__ wint_t;
|
133
|
+
#endif
|
134
|
+
#undef __need_wint_t
|
135
|
+
#endif /* __need_wint_t */
|
136
|
+
|
137
|
+
#endif
|