Skip to content

Commit

Permalink
xnu-3247.1.106
Browse files Browse the repository at this point in the history
  • Loading branch information
Darwin authored and das committed Jun 4, 2017
1 parent b1bb36c commit dd3bee7
Show file tree
Hide file tree
Showing 1,152 changed files with 107,761 additions and 59,764 deletions.
Binary file removed .DS_Store
Binary file not shown.
121 changes: 121 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Format of this file is YAML
# Minimum clang-format version required: clang-format version 3.6.0
# Detailed description of options available at http://clang.llvm.org/docs/ClangFormatStyleOptions.html

AlignEscapedNewlinesLeft: true
# Bad:
# void foo() {
# someFunction();
# someOtherFunction();
# }
# Good:
# void foo() {
# someFunction();
# someOtherFunction();
# }

AlignTrailingComments: true
# align all comments to right based of //
# == Avoid using // based comments altogether ==

AllowAllParametersOfDeclarationOnNextLine: true
# allow funtion definition as
# someFunction(foo,
# bar,
# baz);

AlignConsecutiveAssignments: true
# aligns consecutive assignments with '=' operator

AllowShortBlocksOnASingleLine: true
# single statement block can be merged on one line
# e.g if (a) { return; }

AllowShortCaseLabelsOnASingleLine: false
# Single statement case statements should be on their own lines

AllowShortFunctionsOnASingleLine: None
# Bad:
# int foo() { return 123; }

AllowShortIfStatementsOnASingleLine: false
# Bad:
# if (someOtherVar) return;
# Good:
# if (someOtherVar)
# return;

AllowShortLoopsOnASingleLine: false
# Bad:
# while(i>0) i--;
# Good:
# while(i>0) {
# i--;
# }

AlwaysBreakAfterDefinitionReturnType: true
# Ensures return type is one its own line
# e.g. unsigned int
# function(char param) { }

AlwaysBreakBeforeMultilineStrings: true
# multine strings should begin on new line

BinPackArguments: true
BinPackParameters: false
# functions arguments should all be on one line or have a single line for each param

BreakBeforeBinaryOperators: None
# break for new line after binary operator in case of length is over ColumnLimit
# e.g.
# int foo = bar +
# baz;

BreakBeforeBraces: Linux
# Always attach braces to surrounding context except -
# break before braces on function, namespace and class definitions

ColumnLimit: 132
# every body has wide screen now. 132 seems to be reasonable limit now.

IndentCaseLabels: false
# case labels have same indentation as switch statement.

IndentWidth: 4
# 4 spaces for indentation
TabWidth: 4
# tabwidth is 4 spaces

UseTab: ForIndentation
# tab for indentation only. All alignment should happen with spaces
# Simple rule to check.
# No tabs allowed after first 'non-tab' character in a line

IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
# remove excess empty lines at start of blocks.

PointerAlignment: Middle

SpaceAfterCStyleCast: false
# No space after (cast). E.g
# int blah = (int)((void *)foo + bar)

SpaceBeforeAssignmentOperators: true
# Assignment = should be seperated by spaces on both sides.

SpaceBeforeParens: ControlStatements
# for control statements a space is required before '{'
# Bad: for(){ statement; }
# Good: for() { statement; }

SpaceInEmptyParentheses: false
# No spaces required for empty ()

SpacesInCStyleCastParentheses: false
# No spaces required for (unsigned int) type cast

SpacesInParentheses: false

SpacesInSquareBrackets: false
# No spaces in [count] style invocations of []
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Any level
BUILD/
build/
.DS_Store

# /
/.remotebuild_credential
/cscope.*
/TAGS
/tags

# /libkern/c++/Tests/TestSerialization/test1/test1.xcodeproj/
/libkern/c++/Tests/TestSerialization/test1/test1.xcodeproj/xcuserdata

# /libkern/c++/Tests/TestSerialization/test2/test2.xcodeproj/
/libkern/c++/Tests/TestSerialization/test2/test2.xcodeproj/xcuserdata

# /libkern/kmod/libkmod.xcodeproj/
/libkern/kmod/libkmod.xcodeproj/xcuserdata

# /libsyscall/Libsyscall.xcodeproj/
/libsyscall/Libsyscall.xcodeproj/xcuserdata
/libsyscall/Libsyscall.xcodeproj/project.xcworkspace

# /tools/lldbmacros/
/tools/lldbmacros/*.pyc

# /tools/lldbmacros/core/
/tools/lldbmacros/core/*.pyc

# /tools/lldbmacros/plugins/
/tools/lldbmacros/plugins/*.pyc

# /tools/tests/perf_index/PerfIndex_COPS_Module/PerfIndex.xcodeproj/
/tools/tests/perf_index/PerfIndex_COPS_Module/PerfIndex.xcodeproj/xcuserdata

# /tools/tests/testkext/testkext.xcodeproj/
/tools/tests/testkext/testkext.xcodeproj/xcuserdata

# /tools/tests/unit_tests/cpu_monitor_tests_11646922_src/cpu_hog/cpu_hog.xcodeproj/
/tools/tests/unit_tests/cpu_monitor_tests_11646922_src/cpu_hog/cpu_hog.xcodeproj/xcuserdata

# /tools/tests/unit_tests/monitor_stress_12901965_src/monitor_stress.xcodeproj/
/tools/tests/unit_tests/monitor_stress_12901965_src/monitor_stress.xcodeproj/xcuserdata

# /tools/tests/unit_tests/monitor_stress_12901965_src/monitor_stress.xcodeproj/project.xcworkspace/
/tools/tests/unit_tests/monitor_stress_12901965_src/monitor_stress.xcodeproj/project.xcworkspace/xcuserdata

# /tools/tests/zero-to-n
/tools/tests/zero-to-n/zn*
2 changes: 1 addition & 1 deletion EXTERNAL_HEADERS/AssertMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) { \
DEBUG_ASSERT_MESSAGE( \
DEBUG_ASSERT_COMPONENT_NAME_STRING, \
#errorCode " == 0 ", 0, 0, __FILE__, __LINE__, 0 ); \
#errorCode " == 0 ", 0, 0, __FILE__, __LINE__, evalOnceErrorCode ); \
action; \
} \
} while (0)
Expand Down
185 changes: 166 additions & 19 deletions EXTERNAL_HEADERS/Availability.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007-2011 by Apple Inc.. All rights reserved.
* Copyright (c) 2007-2015 by Apple Inc.. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
Expand Down Expand Up @@ -127,29 +127,41 @@
#define __MAC_10_8 1080
#define __MAC_10_9 1090
#define __MAC_10_10 101000
#define __MAC_10_10_2 101002
#define __MAC_10_10_3 101003
#define __MAC_10_11 101100
/* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */

#define __IPHONE_2_0 20000
#define __IPHONE_2_1 20100
#define __IPHONE_2_2 20200
#define __IPHONE_3_0 30000
#define __IPHONE_3_1 30100
#define __IPHONE_3_2 30200
#define __IPHONE_4_0 40000
#define __IPHONE_4_1 40100
#define __IPHONE_4_2 40200
#define __IPHONE_4_3 40300
#define __IPHONE_5_0 50000
#define __IPHONE_5_1 50100
#define __IPHONE_6_0 60000
#define __IPHONE_6_1 60100
#define __IPHONE_7_0 70000
#define __IPHONE_7_1 70100
#define __IPHONE_8_0 80000
#define __IPHONE_2_0 20000
#define __IPHONE_2_1 20100
#define __IPHONE_2_2 20200
#define __IPHONE_3_0 30000
#define __IPHONE_3_1 30100
#define __IPHONE_3_2 30200
#define __IPHONE_4_0 40000
#define __IPHONE_4_1 40100
#define __IPHONE_4_2 40200
#define __IPHONE_4_3 40300
#define __IPHONE_5_0 50000
#define __IPHONE_5_1 50100
#define __IPHONE_6_0 60000
#define __IPHONE_6_1 60100
#define __IPHONE_7_0 70000
#define __IPHONE_7_1 70100
#define __IPHONE_8_0 80000
#define __IPHONE_8_1 80100
#define __IPHONE_8_2 80200
#define __IPHONE_8_3 80300
#define __IPHONE_8_4 80400
#define __IPHONE_9_0 90000
/* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */

#include <AvailabilityInternal.h>
#define __TVOS_9_0 90000

#define __WATCHOS_1_0 10000
#define __WATCHOS_2_0 20000

#include <AvailabilityInternal.h>

#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
#define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
Expand All @@ -172,4 +184,139 @@
#endif


#if defined(__has_feature)
#if __has_feature(attribute_availability_with_message)
#define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability,message=_msg)))
#else
#define __OS_AVAILABILITY(_target, _availability)
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
#endif
#else
#define __OS_AVAILABILITY(_target, _availability)
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
#endif


/* for use to document app extension usage */
#if defined(__has_feature)
#if __has_feature(attribute_availability_app_extension)
#define __OSX_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(macosx_app_extension,unavailable,_msg)
#define __IOS_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(ios_app_extension,unavailable,_msg)
#else
#define __OSX_EXTENSION_UNAVAILABLE(_msg)
#define __IOS_EXTENSION_UNAVAILABLE(_msg)
#endif
#else
#define __OSX_EXTENSION_UNAVAILABLE(_msg)
#define __IOS_EXTENSION_UNAVAILABLE(_msg)
#endif

#define __OS_EXTENSION_UNAVAILABLE(_msg) __OSX_EXTENSION_UNAVAILABLE(_msg) __IOS_EXTENSION_UNAVAILABLE(_msg)



/* for use marking APIs available info for Mac OSX */
#if defined(__has_feature)
#if __has_attribute(availability)
#define __OSX_UNAVAILABLE __OS_AVAILABILITY(macosx,unavailable)
#define __OSX_AVAILABLE(_vers) __OS_AVAILABILITY(macosx,introduced=_vers)
#define __OSX_DEPRECATED(_start, _dep, _msg) __OSX_AVAILABLE(_start) __OS_AVAILABILITY_MSG(macosx,deprecated=_dep,_msg)
#endif
#endif

#ifndef __OSX_UNAVAILABLE
#define __OSX_UNAVAILABLE
#endif

#ifndef __OSX_AVAILABLE
#define __OSX_AVAILABLE(_vers)
#endif

#ifndef __OSX_DEPRECATED
#define __OSX_DEPRECATED(_start, _dep, _msg)
#endif


/* for use marking APIs available info for iOS */
#if defined(__has_feature)
#if __has_attribute(availability)
#define __IOS_UNAVAILABLE __OS_AVAILABILITY(ios,unavailable)
#define __IOS_PROHIBITED __OS_AVAILABILITY(ios,unavailable)
#define __IOS_AVAILABLE(_vers) __OS_AVAILABILITY(ios,introduced=_vers)
#define __IOS_DEPRECATED(_start, _dep, _msg) __IOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(ios,deprecated=_dep,_msg)
#endif
#endif

#ifndef __IOS_UNAVAILABLE
#define __IOS_UNAVAILABLE
#endif

#ifndef __IOS_PROHIBITED
#define __IOS_PROHIBITED
#endif

#ifndef __IOS_AVAILABLE
#define __IOS_AVAILABLE(_vers)
#endif

#ifndef __IOS_DEPRECATED
#define __IOS_DEPRECATED(_start, _dep, _msg)
#endif


/* for use marking APIs available info for tvOS */
#if defined(__has_feature)
#if __has_feature(attribute_availability_tvos)
#define __TVOS_UNAVAILABLE __OS_AVAILABILITY(tvos,unavailable)
#define __TVOS_PROHIBITED __OS_AVAILABILITY(tvos,unavailable)
#define __TVOS_AVAILABLE(_vers) __OS_AVAILABILITY(tvos,introduced=_vers)
#define __TVOS_DEPRECATED(_start, _dep, _msg) __TVOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(tvos,deprecated=_dep,_msg)
#endif
#endif

#ifndef __TVOS_UNAVAILABLE
#define __TVOS_UNAVAILABLE
#endif

#ifndef __TVOS_PROHIBITED
#define __TVOS_PROHIBITED
#endif

#ifndef __TVOS_AVAILABLE
#define __TVOS_AVAILABLE(_vers)
#endif

#ifndef __TVOS_DEPRECATED
#define __TVOS_DEPRECATED(_start, _dep, _msg)
#endif


/* for use marking APIs available info for Watch OS */
#if defined(__has_feature)
#if __has_feature(attribute_availability_watchos)
#define __WATCHOS_UNAVAILABLE __OS_AVAILABILITY(watchos,unavailable)
#define __WATCHOS_PROHIBITED __OS_AVAILABILITY(watchos,unavailable)
#define __WATCHOS_AVAILABLE(_vers) __OS_AVAILABILITY(watchos,introduced=_vers)
#define __WATCHOS_DEPRECATED(_start, _dep, _msg) __WATCHOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(watchos,deprecated=_dep,_msg)
#endif
#endif

#ifndef __WATCHOS_UNAVAILABLE
#define __WATCHOS_UNAVAILABLE
#endif

#ifndef __WATCHOS_PROHIBITED
#define __WATCHOS_PROHIBITED
#endif

#ifndef __WATCHOS_AVAILABLE
#define __WATCHOS_AVAILABLE(_vers)
#endif

#ifndef __WATCHOS_DEPRECATED
#define __WATCHOS_DEPRECATED(_start, _dep, _msg)
#endif


#endif /* __AVAILABILITY__ */
Loading

0 comments on commit dd3bee7

Please sign in to comment.