From 3f2fe222810c5874cf63fda254c2315ef1d2d1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Wed, 5 Feb 2025 13:44:36 +0100 Subject: [PATCH] Add support for clang_format options version 16. (#2062) --- .clang-format_12 | 1 + .clang-format_13 | 1 + .clang-format_14 | 1 + .clang-format_15 | 1 + .clang-format_16 | 123 +++++++++++++++++++++++++++++++++++ CMakeLists.txt | 7 +- vulkan/vulkan.cppm | 8 +++ vulkan/vulkan_hash.hpp | 2 +- vulkan/vulkan_hpp_macros.hpp | 2 +- 9 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 .clang-format_16 diff --git a/.clang-format_12 b/.clang-format_12 index b177501..bf1c1ae 100644 --- a/.clang-format_12 +++ b/.clang-format_12 @@ -44,6 +44,7 @@ BraceWrapping : SplitEmptyNamespace : true BreakBeforeBinaryOperators : None BreakBeforeBraces : Custom +BreakBeforeConceptDeclarations : Always BreakBeforeTernaryOperators : true BreakConstructorInitializers : BeforeComma BreakInheritanceList : BeforeComma diff --git a/.clang-format_13 b/.clang-format_13 index 2e255d5..b6d70c6 100644 --- a/.clang-format_13 +++ b/.clang-format_13 @@ -45,6 +45,7 @@ BraceWrapping : SplitEmptyNamespace : true BreakBeforeBinaryOperators : None BreakBeforeBraces : Custom +BreakBeforeConceptDeclarations : Always BreakBeforeTernaryOperators : true BreakConstructorInitializers : BeforeComma BreakInheritanceList : BeforeComma diff --git a/.clang-format_14 b/.clang-format_14 index d668fde..d5fc531 100644 --- a/.clang-format_14 +++ b/.clang-format_14 @@ -44,6 +44,7 @@ BraceWrapping : SplitEmptyNamespace : true BreakBeforeBinaryOperators : None BreakBeforeBraces : Custom +BreakBeforeConceptDeclarations : Always BreakBeforeTernaryOperators : true BreakConstructorInitializers : BeforeComma BreakInheritanceList : BeforeComma diff --git a/.clang-format_15 b/.clang-format_15 index 1d47831..c2d131b 100644 --- a/.clang-format_15 +++ b/.clang-format_15 @@ -44,6 +44,7 @@ BraceWrapping : SplitEmptyNamespace : true BreakBeforeBinaryOperators : None BreakBeforeBraces : Custom +BreakBeforeConceptDeclarations : Always BreakBeforeTernaryOperators : true BreakConstructorInitializers : BeforeComma BreakInheritanceList : BeforeComma diff --git a/.clang-format_16 b/.clang-format_16 new file mode 100644 index 0000000..23ed4e2 --- /dev/null +++ b/.clang-format_16 @@ -0,0 +1,123 @@ +--- +AccessModifierOffset : -2 +AlignAfterOpenBracket : Align +AlignArrayOfStructures : None +AlignConsecutiveAssignments : Consecutive +AlignConsecutiveBitFields : Consecutive +AlignConsecutiveDeclarations : Consecutive +AlignConsecutiveMacros : Consecutive +AlignEscapedNewlines : Left +AlignOperands : AlignAfterOperator +AlignTrailingComments : + Kind : Always + OverEmptyLines : 0 +AllowAllArgumentsOnNextLine : true +AllowAllParametersOfDeclarationOnNextLine : true +AllowShortBlocksOnASingleLine : Empty +AllowShortCaseLabelsOnASingleLine : true +AllowShortEnumsOnASingleLine : true +AllowShortFunctionsOnASingleLine : Empty +AllowShortIfStatementsOnASingleLine : Never +AllowShortLambdasOnASingleLine : All +AllowShortLoopsOnASingleLine : false +AlwaysBreakAfterReturnType : None +AlwaysBreakBeforeMultilineStrings : true +AlwaysBreakTemplateDeclarations : Yes +BinPackArguments : false +BinPackParameters : false +BitFieldColonSpacing : Both +BraceWrapping : + AfterCaseLabel : true + AfterClass : true + AfterControlStatement : Always + AfterEnum : true + AfterFunction : true + AfterNamespace : true + AfterStruct : true + AfterUnion : true + AfterExternBlock : true + BeforeCatch : true + BeforeElse : true + BeforeLambdaBody : true + BeforeWhile : false + IndentBraces : false + SplitEmptyFunction : true + SplitEmptyRecord : true + SplitEmptyNamespace : true +BreakAfterAttributes: Leave +BreakBeforeBinaryOperators : None +BreakBeforeBraces : Custom +BreakBeforeConceptDeclarations : Always +BreakBeforeInlineASMColon : OnlyMultiline +BreakBeforeTernaryOperators : true +BreakConstructorInitializers : BeforeComma +BreakInheritanceList : BeforeComma +BreakStringLiterals : false +ColumnLimit : 160 +CompactNamespaces : false +ConstructorInitializerIndentWidth : 2 +ContinuationIndentWidth : 2 +Cpp11BracedListStyle : false +EmptyLineAfterAccessModifier : Never +EmptyLineBeforeAccessModifier : LogicalBlock +FixNamespaceComments : true +IncludeBlocks : Regroup +IndentAccessModifiers : false +IndentCaseBlocks : true +IndentCaseLabels : true +IndentExternBlock : true +IndentPPDirectives : AfterHash +IndentRequiresClause : false +IndentWidth : 2 +IndentWrappedFunctionNames : true +InsertBraces : false +InsertNewlineAtEOF : true +IntegerLiteralSeparator : + Binary : 4 + Decimal : 0 + Hex : 2 + HexMinDigits : 6 +KeepEmptyLinesAtTheStartOfBlocks : false +LambdaBodyIndentation : Signature +MaxEmptyLinesToKeep : 1 +NamespaceIndentation : All +PackConstructorInitializers : NextLine +PPIndentWidth : -1 +PointerAlignment : Middle +ReferenceAlignment : Pointer +ReflowComments : true +RemoveBracesLLVM : false +RequiresClausePosition : OwnLine +RequiresExpressionIndentation : Keyword +SeparateDefinitionBlocks : Always +ShortNamespaceLines : 0 +SortIncludes : true +SortUsingDeclarations : true +SpaceAfterCStyleCast : false +SpaceAfterLogicalNot : false +SpaceAfterTemplateKeyword : true +SpaceAroundPointerQualifiers : Both +SpaceBeforeAssignmentOperators : true +SpaceBeforeCaseColon : false +SpaceBeforeCpp11BracedList : false +SpaceBeforeCtorInitializerColon : true +SpaceBeforeInheritanceColon : true +SpaceBeforeParens : ControlStatements +SpaceBeforeRangeBasedForLoopColon : true +SpaceBeforeSquareBrackets : false +SpaceInEmptyBlock : false +SpaceInEmptyParentheses : false +SpacesBeforeTrailingComments : 2 +SpacesInAngles : false +SpacesInCStyleCastParentheses : false +SpacesInConditionalStatement : true +SpacesInContainerLiterals : false +SpacesInLineCommentPrefix : + Minimum : 1 + Maximum : -1 +SpacesInParentheses : true +SpacesInSquareBrackets : false +Standard : Latest +UseCRLF : true +UseTab : Never +... diff --git a/CMakeLists.txt b/CMakeLists.txt index 2003edc..090d8fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,9 +97,12 @@ if ( VULKAN_HPP_GENERATOR_BUILD ) elseif( clangFormatVersion VERSION_LESS 15.0.0 ) message( STATUS " Using .clang-format version 14." ) file( READ ".clang-format_14" clangFormat ) - else() - message(STATUS " Using .clang-format version 15." ) + elseif( clangFormatVersion VERSION_LESS 16.0.0 ) + message( STATUS " Using .clang-format version 15." ) file( READ ".clang-format_15" clangFormat ) + else() + message(STATUS " Using .clang-format version 16." ) + file( READ ".clang-format_16" clangFormat ) endif() file( WRITE ".clang-format" ${clangFormat} ) endif() diff --git a/vulkan/vulkan.cppm b/vulkan/vulkan.cppm index 1c66c4b..965e6ef 100644 --- a/vulkan/vulkan.cppm +++ b/vulkan/vulkan.cppm @@ -8483,6 +8483,14 @@ export namespace std template <> struct hash; + //=============================================== + //=== Required exports for vk::StructureChain === + //=============================================== + +#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) + using std::tuple_element; + using std::tuple_size; +#endif } // namespace std // This VkFlags type is used as part of a bitfield in some structure. diff --git a/vulkan/vulkan_hash.hpp b/vulkan/vulkan_hash.hpp index 353d2f6..5115292 100644 --- a/vulkan/vulkan_hash.hpp +++ b/vulkan/vulkan_hash.hpp @@ -563,7 +563,7 @@ namespace std # if !defined( VULKAN_HPP_HASH_COMBINE ) # define VULKAN_HPP_HASH_COMBINE( seed, value ) \ - seed ^= std::hash::type>{}( value ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ) + seed ^= std::hash::type>{}( value ) + 0x9e'37'79'b9 + ( seed << 6 ) + ( seed >> 2 ) # endif template <> diff --git a/vulkan/vulkan_hpp_macros.hpp b/vulkan/vulkan_hpp_macros.hpp index a218f72..7e1ca7a 100644 --- a/vulkan/vulkan_hpp_macros.hpp +++ b/vulkan/vulkan_hpp_macros.hpp @@ -323,4 +323,4 @@ namespace VULKAN_HPP_NAMESPACE # define VULKAN_HPP_RAII_CREATE_NOEXCEPT #endif -#endif \ No newline at end of file +#endif