From ff6a6ea85837fbd1cdd34788ab2f5003eefe7111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=A4fer?= Date: Thu, 2 Mar 2017 11:06:07 +0100 Subject: [PATCH] disable some warnings that might be leaked into use code by conditional redefinition of LibFlatArray macros for MSVC, re #27 --- include/libflatarray/macros.hpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/include/libflatarray/macros.hpp b/include/libflatarray/macros.hpp index f42d7fb..0c8389b 100644 --- a/include/libflatarray/macros.hpp +++ b/include/libflatarray/macros.hpp @@ -45,6 +45,24 @@ template \ friend class LibFlatArray::detail::flat_array::offset; + + +#ifdef _MSC_BUILD +/** + * This macros registers a type with LibFlatArray so that it can be + * used with soa_grid, soa_array and friends. It will instantiate all + * templates required for the "Struct of Arrays" (SoA) storage and + * adds utilities so that user code can also discover properties of + * the SoA layout. + */ +# define LIBFLATARRAY_REGISTER_SOA(CELL_TYPE, CELL_MEMBERS) \ + __pragma( warning( push ) ) \ + __pragma( warning( disable : 4514 ) ) \ + LIBFLATARRAY_REGISTER_SOA_MAIN(CELL_TYPE, CELL_MEMBERS) \ + __pragma( warning( pop ) ) \ + +#else + /** * This macros registers a type with LibFlatArray so that it can be * used with soa_grid, soa_array and friends. It will instantiate all @@ -52,7 +70,12 @@ * adds utilities so that user code can also discover properties of * the SoA layout. */ -#define LIBFLATARRAY_REGISTER_SOA(CELL_TYPE, CELL_MEMBERS) \ +# define LIBFLATARRAY_REGISTER_SOA(CELL_TYPE, CELL_MEMBERS) \ + LIBFLATARRAY_REGISTER_SOA_MAIN(CELL_TYPE, CELL_MEMBERS) \ + +#endif + +#define LIBFLATARRAY_REGISTER_SOA_MAIN(CELL_TYPE, CELL_MEMBERS) \ namespace LibFlatArray { \ \ LIBFLATARRAY_FOR_EACH( \