From fcbf327b16a459735bfab7811c6b4a79c1ad207d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 13 Mar 2024 17:12:24 +0100 Subject: [PATCH] workaround absence of --- .../Polygon_repair/repair_polygon_2_test.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Polygon_repair/test/Polygon_repair/repair_polygon_2_test.cpp b/Polygon_repair/test/Polygon_repair/repair_polygon_2_test.cpp index 6b673faf639..3ca4f4225df 100644 --- a/Polygon_repair/test/Polygon_repair/repair_polygon_2_test.cpp +++ b/Polygon_repair/test/Polygon_repair/repair_polygon_2_test.cpp @@ -3,6 +3,19 @@ #include #include + +// work around for old compilers (Apple clang < 11 for example) +#define HAS_FILESYSTEM 1 +#if (__has_include) +#if !__has_include() +#undef HAS_FILESYSTEM +#define HAS_FILESYSTEM 0 +#endif +#endif + + +#if HAS_FILESYSTEM + #include #include #include @@ -80,3 +93,13 @@ int main() { return 0; } + +#else + +int main() +{ + std::cout << "Warning: filesystem feature is not present on the system, nothing will be tested\n"; + return 0; +} + +#endif