1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
|
/*------------------------------------------------------------------
* safe_config.h -- Safe C Lib configs
* @configure_input@
*
* August 2017, Reini Urban
* September 2022, Reini Urban
*
* Copyright (c) 2017,2022 by Reini Urban
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*------------------------------------------------------------------
*/
#ifndef __SAFE_LIB_CONFIG_H__
#define __SAFE_LIB_CONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __MINGW32__
# if defined __MINGW64_VERSION_MAJOR && defined __MINGW64_VERSION_MINOR
# define HAVE_MINGW64 /* mingw-w64 (either 32 or 64bit) */
# else
# define HAVE_MINGW32 /* old mingw */
# endif
#endif
/*
* Safe Lib specific configuration values.
*/
/*
* We depart from the C11 standard and allow memory and string
* operations to have different max sizes. See the respective
* safe_mem_lib.h or safe_str_lib.h files.
*/
#ifndef RSIZE_MAX_MEM
/* maximum buffer length. default: 256UL << 20 (256MB) */
#define RSIZE_MAX_MEM @RSIZE_MAX_MEM@
#endif
#ifndef RSIZE_MAX_STR
/* maximum string length. default: 4UL << 10 (4KB) */
#define RSIZE_MAX_STR @RSIZE_MAX_STR@
#endif
/* Null out the remaining part of a string buffer if it is not completely used */
@INSERT_NULLSLACK@
/* Disable the C11 invoke_safe_{str,mem}_constraint_handler callbacks on
errors, for performance, smaller size and less flexibility. */
@INSERT_CONSTRAINT_HANDLER@
/* Define to include some additional unsafe C11 functions:
* tmpnam_s
*/
@INSERT_UNSAFE@
/* Define to disable additional functions not defined
* in the C11 appendix K specification
*/
@INSERT_EXTS@
/* Define to disable new multibyte and wchar support.
* E.g. for the linux kernel
*/
@INSERT_DISABLE_WCHAR@
/* Define to disable linking with dllimport, only relevant to windows.
* Defined with a static libsafec.
*/
@INSERT_DISABLE_DLLIMPORT@
/*
* Defined by your compiler when __builtin_object_size() is available
* for compile-time dmax checks. Override when you use a different compiler.
* Available since: clang-3.3+, gcc-4.1+.
*/
#ifndef HAVE___BUILTIN_OBJECT_SIZE
@INSERT_OBJECT_SIZE@
#endif
/*
* Defined by your compiler when __builtin_constant_p() is available
* for compile-time checks. Override when you use a different compiler.
* Available since: clang-3.1+, gcc-3.4+.
*/
#ifndef HAVE___BUILTIN_CONSTANT_P
@INSERT_CONSTANT_P@
#endif
/*
* Defined by --enable-warn-dmax, to enable dmax checks against
* __builtin_object_size(dest)
*/
@INSERT_WARN_DMAX@
/*
* Defined by --enable-error-dmax to make HAVE_WARN_DMAX fatal
*/
@INSERT_ERROR_DMAX@
/*
* Set if libsafec3 was compiled with C99 support.
*/
@INSERT_SAFECLIB_HAVE_C99@
/*
* Set to a default ignopre or abort default handler.
*/
@INSERT_DEFAULT_HANDLER@
/*
* The spec does not call out a maximum len for the strtok src
* string (the max delims size), so one is defined here.
*/
#ifndef STRTOK_DELIM_MAX_LEN
#define STRTOK_DELIM_MAX_LEN 16
#endif
#ifdef __cplusplus
}
#endif
#endif /* __SAFE_LIB_CONFIG_H__ */
|