%% options copyright owner = Dirk Krause copyright year = 2019-xxxx SPDX-License-Identifier: BSD-3-Clause %% header /** @file dk4use.h Define constants which feature to use. */ #ifndef DK4CONF_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" #else #include #endif #endif /* For cross-compiled programs wchar_t string output failed after _setmode(_fileno(stdout), _O_U16TEXT); So we use it only when using MS C compiler. */ #ifndef DK4_USE_SETMODE_UTF16 #if (_WIN32) && (DK4_CHAR_SIZE > 1) && defined(_MSC_VER) \ && DK4_HAVE__SETMODE && defined(_O_U16TEXT) /** Use _setmode() before writing wchar_t strings on Windows. */ #define DK4_USE_SETMODE_UTF16 1 #else /** Do not use _setmode() before writing wchar_t strings on Windows. */ #define DK4_USE_SETMODE_UTF16 0 #endif #endif /* Here we keep the possibility to select more detailed where to use _setmode(_fileno(stdout), _O_BINARY); and back. */ #ifndef DK4_USE_SETMODE_BINARY #if (_WIN32) && defined (_MSC_VER) && DK_HAVE__SETMODE && defined(_O_BINARY) /** Switch between binary mode and text mode. */ #define DK4_USE_SETMODE_BINARY 1 #else /** Do not switch between binary and text mode. */ #define DK4_USE_SETMODE_BINARY 0 #endif #endif #ifndef DK4_USE_PRAGMA_WARNING_DISABLE #if (_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1700) /** Use "pragma warning (disable:4206)" and alike. */ #define DK4_USE_PRAGMA_WARNING_DISABLE 1 #else /** Do not use "pragma warning (disable:4206)" and alike. */ #define DK4_USE_PRAGMA_WARNING_DISABLE 0 #endif #endif #ifndef DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS #if (_WIN32) && defined(_MSC_VER) /** Use Windows floating point exceptions. */ #define DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS 1 #else /** Do not use Windows floating point exceptions. */ #define DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS 0 #endif #endif #ifndef DK4_USE_PARANOID_MEMORY_CHECK /** Paranoid memory check is not enabled as this is self-made code probably decreasing performance. When calling dk4mem_reset_secure() this check checks each byte to be zero. */ #define DK4_USE_PARANOID_MEMORY_CHECK 0 #endif