diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h')
-rw-r--r-- | contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h b/contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h index c1df64c608..6ba814703b 100644 --- a/contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h +++ b/contrib/libs/cxxsupp/openmp/kmp_safe_c_api.h @@ -1,62 +1,62 @@ - -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.txt for details. -// -//===----------------------------------------------------------------------===// - - -#ifndef KMP_SAFE_C_API_H -#define KMP_SAFE_C_API_H - -// -// Replacement for banned C API -// - -// Not every unsafe call listed here is handled now, but keeping everything -// in one place should be handy for future maintenance. -#if KMP_OS_WINDOWS - -# define RSIZE_MAX_STR ( 4UL << 10 ) // 4KB - -// _malloca was suggested, but it is not a drop-in replacement for _alloca -# define KMP_ALLOCA _alloca - -# define KMP_MEMCPY_S memcpy_s -# define KMP_SNPRINTF sprintf_s -# define KMP_SSCANF sscanf_s -# define KMP_STRCPY_S strcpy_s -# define KMP_STRNCPY_S strncpy_s - -// Use this only when buffer size is unknown -# define KMP_MEMCPY(dst, src, cnt) memcpy_s(dst, cnt, src, cnt) - -# define KMP_STRLEN(str) strnlen_s(str, RSIZE_MAX_STR) - -// Use this only when buffer size is unknown -# define KMP_STRNCPY(dst, src, cnt) strncpy_s(dst, cnt, src, cnt) - -// _TRUNCATE insures buffer size > max string to print. -# define KMP_VSNPRINTF(dst, cnt, fmt, arg) vsnprintf_s(dst, cnt, _TRUNCATE, fmt, arg) - -#else // KMP_OS_WINDOWS - -// For now, these macros use the existing API. - -# define KMP_ALLOCA alloca -# define KMP_MEMCPY_S(dst, bsz, src, cnt) memcpy(dst, src, cnt) -# define KMP_SNPRINTF snprintf -# define KMP_SSCANF sscanf -# define KMP_STRCPY_S(dst, bsz, src) strcpy(dst, src) -# define KMP_STRNCPY_S(dst, bsz, src, cnt) strncpy(dst, src, cnt) -# define KMP_VSNPRINTF vsnprintf -# define KMP_STRNCPY strncpy -# define KMP_STRLEN strlen -# define KMP_MEMCPY memcpy - -#endif // KMP_OS_WINDOWS - -#endif // KMP_SAFE_C_API_H + +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.txt for details. +// +//===----------------------------------------------------------------------===// + + +#ifndef KMP_SAFE_C_API_H +#define KMP_SAFE_C_API_H + +// +// Replacement for banned C API +// + +// Not every unsafe call listed here is handled now, but keeping everything +// in one place should be handy for future maintenance. +#if KMP_OS_WINDOWS + +# define RSIZE_MAX_STR ( 4UL << 10 ) // 4KB + +// _malloca was suggested, but it is not a drop-in replacement for _alloca +# define KMP_ALLOCA _alloca + +# define KMP_MEMCPY_S memcpy_s +# define KMP_SNPRINTF sprintf_s +# define KMP_SSCANF sscanf_s +# define KMP_STRCPY_S strcpy_s +# define KMP_STRNCPY_S strncpy_s + +// Use this only when buffer size is unknown +# define KMP_MEMCPY(dst, src, cnt) memcpy_s(dst, cnt, src, cnt) + +# define KMP_STRLEN(str) strnlen_s(str, RSIZE_MAX_STR) + +// Use this only when buffer size is unknown +# define KMP_STRNCPY(dst, src, cnt) strncpy_s(dst, cnt, src, cnt) + +// _TRUNCATE insures buffer size > max string to print. +# define KMP_VSNPRINTF(dst, cnt, fmt, arg) vsnprintf_s(dst, cnt, _TRUNCATE, fmt, arg) + +#else // KMP_OS_WINDOWS + +// For now, these macros use the existing API. + +# define KMP_ALLOCA alloca +# define KMP_MEMCPY_S(dst, bsz, src, cnt) memcpy(dst, src, cnt) +# define KMP_SNPRINTF snprintf +# define KMP_SSCANF sscanf +# define KMP_STRCPY_S(dst, bsz, src) strcpy(dst, src) +# define KMP_STRNCPY_S(dst, bsz, src, cnt) strncpy(dst, src, cnt) +# define KMP_VSNPRINTF vsnprintf +# define KMP_STRNCPY strncpy +# define KMP_STRLEN strlen +# define KMP_MEMCPY memcpy + +#endif // KMP_OS_WINDOWS + +#endif // KMP_SAFE_C_API_H |