From 511ee9bf05fe89137d02eff2b46e326335b8960f Mon Sep 17 00:00:00 2001 From: redtide Date: Thu, 19 Sep 2019 02:24:46 +0200 Subject: [PATCH] Moved filesystem.h in the compat folder with other C++14 compatibility related files, adapted macro, removed unnecessary license header for those files. --- sfizz/compat/algorithm.h | 23 ----------------------- sfizz/compat/filesystem.h | 15 +++++++++++++++ sfizz/compat/inline.h | 11 +++++++++++ 3 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 sfizz/compat/filesystem.h create mode 100644 sfizz/compat/inline.h diff --git a/sfizz/compat/algorithm.h b/sfizz/compat/algorithm.h index 0993c4b8..df07f01c 100644 --- a/sfizz/compat/algorithm.h +++ b/sfizz/compat/algorithm.h @@ -1,26 +1,3 @@ -// Copyright (c) 2019, Paul Ferrand -// All rights reserved. - -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #pragma once #include diff --git a/sfizz/compat/filesystem.h b/sfizz/compat/filesystem.h new file mode 100644 index 00000000..d3103fe6 --- /dev/null +++ b/sfizz/compat/filesystem.h @@ -0,0 +1,15 @@ +#pragma once + +#ifdef __cplusplus + #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) + #include + #elif (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) + #warning std::experimental::filesystem in use + #include + namespace std { + namespace filesystem = std::experimental::filesystem; + } + #endif +#else + #error no filesystem support +#endif diff --git a/sfizz/compat/inline.h b/sfizz/compat/inline.h new file mode 100644 index 00000000..6faf861a --- /dev/null +++ b/sfizz/compat/inline.h @@ -0,0 +1,11 @@ +#pragma once + +#ifdef __cplusplus + #if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) + #define SFZ_INLINE inline + #else + #define SFZ_INLINE + #endif +#else + #error unknown error +#endif