/*1This file is part of t8code.2t8code is a C library to manage a collection (a forest) of multiple3connected adaptive space-trees of general element classes in parallel.45Copyright (C) 2025 the developers67t8code is free software; you can redistribute it and/or modify8it under the terms of the GNU General Public License as published by9the Free Software Foundation; either version 2 of the License, or10(at your option) any later version.1112t8code is distributed in the hope that it will be useful,13but WITHOUT ANY WARRANTY; without even the implied warranty of14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15GNU General Public License for more details.1617You should have received a copy of the GNU General Public License18along with t8code; if not, write to the Free Software Foundation, Inc.,1951 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.20*/2122/** \file t8_with_macro_error.h23* This file defines macros to cause an error in user code when using24* deprecated "T8_WITH_*" macros.25* Unfortunately, the error will not be raised in \#ifdef constructions (This is still an open TODO.).26* With https://github.com/DLR-AMR/t8code/issues/1370 we switched all our macros27* that control settings and external libraries to "T8_ENABLE_*".28* Users might not have implmented that change and left "T8_WITH_*" in their code.29* This could lead to unintentionally behaviour if the macros are ignored even if the30* setting would have been enabled.31* Hence, we define a macro that throws an error, whenever a "T8_WITH_*" is called.32* This macro is defined for each "T8_ENABLE_*" option.33*/3435#ifndef T8_WITH_MACRO_ERROR_H36#define T8_WITH_MACRO_ERROR_H3738// clang-format off39// Since we use a symbol that is not part of C/C++ syntax, clang-format would not indent the file.40/** This macro defines the macro "T8_THROW_ERROR_WITH" to cause an error41* whenever it is evaluated. Including \#if usage. (But not including \#ifdef usage).42* Example usage:43* \#define T8_WITH_DEBUG T8_THROW_ERROR_WITH44*45* Using this with46* \#if T8_WITH_DEBUG47* will throw a compile-time error.48*/49#define T8_THROW_ERROR_WITH @"Invalid usage of T8_WITH_*. Use T8_ENABLE_* instead."50// clang-format on5152// We would like to use \#error here to cause a compile time error message,53// however, expanding "\#error" in macros is not supported.54// Instead, we use the symbol "@" which is not part of C/C++ syntax and will throw55// an error when evaluated. See also https://stackoverflow.com/questions/21055507/forcing-preprocessor-error-with-macro5657// We now define all T8_ENABLE_* macros that existed at 28 March 2025 to throw an error58// when called in a T8_WITH_* version.59#define T8_WITH_DEBUG T8_THROW_ERROR_WITH /**< Deprecated debug macro, will produce an error when used with \#if. */60#define T8_WITH_VTK T8_THROW_ERROR_WITH /**< Deprecated vtk macro, will produce an error when used with \#if. */61#define T8_WITH_OCC T8_THROW_ERROR_WITH /**< Deprecated occ macro, will produce an error when used with \#if. */62#define T8_WITH_METIS T8_THROW_ERROR_WITH /**< Deprecated metis macro, will produce an error when used with \#if. */63#define T8_WITH_MPI T8_THROW_ERROR_WITH /**< Deprecated MPI macro, will produce an error when used with \#if. */64#define T8_WITH_MPIIO T8_THROW_ERROR_WITH /**< Deprecated MPIIO macro, will produce an error when used with \#if. */65#define T8_WITH_FORTRAN T8_THROW_ERROR_WITH /**< Deprecated FORTRAN macro, will produce an error when used with \#if. */66#define T8_WITH_CPPSTD T8_THROW_ERROR_WITH /**< Deprecated cppstd macro, will produce an error when used with \#if. */67#define T8_WITH_MODDIR T8_THROW_ERROR_WITH /**< Deprecated moddir macro, will produce an error when used with \#if. */68#define T8_WITH_CUSTOM_TEST_COMMAND T8_THROW_ERROR_WITH /**< Deprecated custom_test_command macro, will produce an error when used with \#if. */6970#endif // T8_WITH_MACRO_ERROR_H717273