From 925f6edad25583f68292bc7026a868ff25ba09aa Mon Sep 17 00:00:00 2001 From: Sharadh Rajaraman Date: Wed, 14 Aug 2024 01:16:52 +0100 Subject: [PATCH] Moved `import std` macro guard to `.cppm` file itself --- VulkanHppGenerator.cpp | 5 +++++ snippets/includes.hpp | 6 +----- vulkan/vulkan.cppm | 5 +++++ vulkan/vulkan.hpp | 6 +----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index ff83b1cec..d5e2954a9 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -794,6 +794,11 @@ void VulkanHppGenerator::generateCppModuleFile() const module; +#include +#if defined( VULKAN_HPP_STD_MODULE ) +import VULKAN_HPP_STD_MODULE; +import VULKAN_HPP_STD_COMPAT_MODULE; +#endif #include #include #include diff --git a/snippets/includes.hpp b/snippets/includes.hpp index 8a66239fa..07b2763c5 100644 --- a/snippets/includes.hpp +++ b/snippets/includes.hpp @@ -1,16 +1,12 @@ -#include - #if !defined( VULKAN_HPP_STD_MODULE ) # include # include // ArrayWrapperND # include // strnlen # include // std::string # include // std::exchange -#else -import VULKAN_HPP_STD_MODULE; -import VULKAN_HPP_STD_COMPAT_MODULE; #endif #include +#include #if 17 <= VULKAN_HPP_CPP_VERSION && !defined( VULKAN_HPP_STD_MODULE ) # include diff --git a/vulkan/vulkan.cppm b/vulkan/vulkan.cppm index b4db70abd..9510d4c3f 100644 --- a/vulkan/vulkan.cppm +++ b/vulkan/vulkan.cppm @@ -10,6 +10,11 @@ module; +#include +#if defined( VULKAN_HPP_STD_MODULE ) +import VULKAN_HPP_STD_MODULE; +import VULKAN_HPP_STD_COMPAT_MODULE; +#endif #include #include #include diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 8af8f5139..27d7dca96 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -8,19 +8,15 @@ #ifndef VULKAN_HPP #define VULKAN_HPP -#include - #if !defined( VULKAN_HPP_STD_MODULE ) # include # include // ArrayWrapperND # include // strnlen # include // std::string # include // std::exchange -#else -import VULKAN_HPP_STD_MODULE; -import VULKAN_HPP_STD_COMPAT_MODULE; #endif #include +#include #if 17 <= VULKAN_HPP_CPP_VERSION && !defined( VULKAN_HPP_STD_MODULE ) # include