diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/check_config_h.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'build/scripts/check_config_h.py')
-rw-r--r-- | build/scripts/check_config_h.py | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/build/scripts/check_config_h.py b/build/scripts/check_config_h.py new file mode 100644 index 0000000000..07bc12e230 --- /dev/null +++ b/build/scripts/check_config_h.py @@ -0,0 +1,89 @@ +import sys + +data = """ +#if defined(SIZEOF_LONG) +static_assert(sizeof(long) == SIZEOF_LONG, "fixme 1"); +#endif + +#if defined(SIZEOF_PTHREAD_T) +#include <pthread.h> + +static_assert(sizeof(pthread_t) == SIZEOF_PTHREAD_T, "fixme 2"); +#endif + +#if defined(SIZEOF_SIZE_T) +#include <stddef.h> + +static_assert(sizeof(size_t) == SIZEOF_SIZE_T, "fixme 3"); +#endif + +#if defined(SIZEOF_TIME_T) +#include <time.h> + +static_assert(sizeof(time_t) == SIZEOF_TIME_T, "fixme 4"); +#endif + +#if defined(SIZEOF_UINTPTR_T) +#include <stdint.h> + +static_assert(sizeof(uintptr_t) == SIZEOF_UINTPTR_T, "fixme 5"); +#endif + +#if defined(SIZEOF_VOID_P) +static_assert(sizeof(void*) == SIZEOF_VOID_P, "fixme 6"); +#endif + +#if defined(SIZEOF_FPOS_T) +#include <stdio.h> + +static_assert(sizeof(fpos_t) == SIZEOF_FPOS_T, "fixme 7"); +#endif + +#if defined(SIZEOF_DOUBLE) +static_assert(sizeof(double) == SIZEOF_DOUBLE, "fixme 8"); +#endif + +#if defined(SIZEOF_LONG_DOUBLE) +static_assert(sizeof(long double) == SIZEOF_LONG_DOUBLE, "fixme 9"); +#endif + +#if defined(SIZEOF_FLOAT) +static_assert(sizeof(float) == SIZEOF_FLOAT, "fixme 10"); +#endif + +#if defined(SIZEOF_INT) +static_assert(sizeof(int) == SIZEOF_INT, "fixme 11"); +#endif + +#if defined(SIZEOF_LONG_LONG) +static_assert(sizeof(long long) == SIZEOF_LONG_LONG, "fixme 12"); +#endif + +#if defined(SIZEOF_OFF_T) +#include <stdio.h> + +static_assert(sizeof(off_t) == SIZEOF_OFF_T, "fixme 13"); +#endif + +#if defined(SIZEOF_PID_T) +#include <unistd.h> + +static_assert(sizeof(pid_t) == SIZEOF_PID_T, "fixme 14"); +#endif + +#if defined(SIZEOF_SHORT) +static_assert(sizeof(short) == SIZEOF_SHORT, "fixme 15"); +#endif + +#if defined(SIZEOF_WCHAR_T) +static_assert(sizeof(wchar_t) == SIZEOF_WCHAR_T, "fixme 16"); +#endif + +#if defined(SIZEOF__BOOL) +//TODO +#endif +""" +if __name__ == '__main__': + with open(sys.argv[2], 'w') as f: + f.write('#include <' + sys.argv[1] + '>\n\n') + f.write(data) |