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 /util/system/defaults.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 'util/system/defaults.h')
-rw-r--r-- | util/system/defaults.h | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/util/system/defaults.h b/util/system/defaults.h index dcd7abea38..d1889519cd 100644 --- a/util/system/defaults.h +++ b/util/system/defaults.h @@ -3,91 +3,91 @@ #include "platform.h" #if defined _unix_ - #define LOCSLASH_C '/' - #define LOCSLASH_S "/" + #define LOCSLASH_C '/' + #define LOCSLASH_S "/" #else - #define LOCSLASH_C '\\' - #define LOCSLASH_S "\\" + #define LOCSLASH_C '\\' + #define LOCSLASH_S "\\" #endif // _unix_ -#if defined(__INTEL_COMPILER) && defined(__cplusplus) - #include <new> -#endif - +#if defined(__INTEL_COMPILER) && defined(__cplusplus) + #include <new> +#endif + // low and high parts of integers #if !defined(_win_) - #include <sys/param.h> + #include <sys/param.h> #endif - + #if defined(BSD) || defined(_android_) - #if defined(BSD) - #include <machine/endian.h> - #endif + #if defined(BSD) + #include <machine/endian.h> + #endif - #if defined(_android_) - #include <endian.h> - #endif + #if defined(_android_) + #include <endian.h> + #endif - #if (BYTE_ORDER == LITTLE_ENDIAN) - #define _little_endian_ - #elif (BYTE_ORDER == BIG_ENDIAN) - #define _big_endian_ - #else - #error unknown endian not supported - #endif + #if (BYTE_ORDER == LITTLE_ENDIAN) + #define _little_endian_ + #elif (BYTE_ORDER == BIG_ENDIAN) + #define _big_endian_ + #else + #error unknown endian not supported + #endif -#elif (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(WHATEVER_THAT_HAS_BIG_ENDIAN) - #define _big_endian_ -#else - #define _little_endian_ -#endif +#elif (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(WHATEVER_THAT_HAS_BIG_ENDIAN) + #define _big_endian_ +#else + #define _little_endian_ +#endif // alignment -#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_QUADS) - #define _must_align8_ +#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_QUADS) + #define _must_align8_ #endif -#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_LONGS) - #define _must_align4_ +#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_LONGS) + #define _must_align4_ #endif -#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_SHORTS) - #define _must_align2_ +#if (defined(_sun_) && !defined(__i386__)) || defined(_hpux_) || defined(__alpha__) || defined(__ia64__) || defined(WHATEVER_THAT_NEEDS_ALIGNING_SHORTS) + #define _must_align2_ #endif #if defined(__GNUC__) - #define alias_hack __attribute__((__may_alias__)) + #define alias_hack __attribute__((__may_alias__)) #endif #ifndef alias_hack - #define alias_hack + #define alias_hack #endif -#include "types.h" - +#include "types.h" + #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) - #define PRAGMA(x) _Pragma(#x) - #define RCSID(idstr) PRAGMA(comment(exestr, idstr)) + #define PRAGMA(x) _Pragma(#x) + #define RCSID(idstr) PRAGMA(comment(exestr, idstr)) #else - #define RCSID(idstr) static const char rcsid[] = idstr + #define RCSID(idstr) static const char rcsid[] = idstr #endif -#include "compiler.h" +#include "compiler.h" #ifdef _win_ - #include <malloc.h> + #include <malloc.h> #elif defined(_sun_) - #include <alloca.h> + #include <alloca.h> #endif #ifdef NDEBUG - #define Y_IF_DEBUG(X) + #define Y_IF_DEBUG(X) #ifdef __cplusplus constexpr bool Y_IS_DEBUG_BUILD = false; #endif #else - #define Y_IF_DEBUG(X) X + #define Y_IF_DEBUG(X) X #ifdef __cplusplus constexpr bool Y_IS_DEBUG_BUILD = true; #endif @@ -120,14 +120,14 @@ constexpr bool Y_IS_DEBUG_BUILD = true; * Since all of our code is expected to work on a 64 bit platform where pointers are 8 bytes we may * falsefully accept pointers to types of sizes that are divisors of 8 (1, 2, 4 and 8). */ -#if defined(__cplusplus) - #include <util/generic/array_size.h> -#else - #undef Y_ARRAY_SIZE - #define Y_ARRAY_SIZE(arr) \ - ((sizeof(arr) / sizeof((arr)[0])) / static_cast<size_t>(!(sizeof(arr) % sizeof((arr)[0])))) -#endif - +#if defined(__cplusplus) + #include <util/generic/array_size.h> +#else + #undef Y_ARRAY_SIZE + #define Y_ARRAY_SIZE(arr) \ + ((sizeof(arr) / sizeof((arr)[0])) / static_cast<size_t>(!(sizeof(arr) % sizeof((arr)[0])))) +#endif + #undef Y_ARRAY_BEGIN #define Y_ARRAY_BEGIN(arr) (arr) @@ -144,12 +144,12 @@ constexpr bool Y_IS_DEBUG_BUILD = true; #define Y_STRINGIZE(X) UTIL_PRIVATE_STRINGIZE_AUX(X) #define UTIL_PRIVATE_STRINGIZE_AUX(X) #X -#if defined(__COUNTER__) - #define Y_GENERATE_UNIQUE_ID(N) Y_CAT(N, __COUNTER__) -#endif - +#if defined(__COUNTER__) + #define Y_GENERATE_UNIQUE_ID(N) Y_CAT(N, __COUNTER__) +#endif + #if !defined(Y_GENERATE_UNIQUE_ID) - #define Y_GENERATE_UNIQUE_ID(N) Y_CAT(N, __LINE__) -#endif + #define Y_GENERATE_UNIQUE_ID(N) Y_CAT(N, __LINE__) +#endif #define NPOS ((size_t)-1) |