diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-04-05 10:30:58 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-04-05 17:53:59 +0300 |
commit | 72e7f011b29998d8a3e15eb5b381ef962af5fe5b (patch) | |
tree | 9fd87a0c6f545552849f466b20d3969a21e21e15 /libmysqlclient/mysql/assert.c | |
parent | 4e0bcdb33411afb02d60b72cbffa278344a572a6 (diff) |
Upgrade to 8.0.15
Diffstat (limited to 'libmysqlclient/mysql/assert.c')
-rw-r--r-- | libmysqlclient/mysql/assert.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libmysqlclient/mysql/assert.c b/libmysqlclient/mysql/assert.c new file mode 100644 index 0000000..9324d67 --- /dev/null +++ b/libmysqlclient/mysql/assert.c @@ -0,0 +1,28 @@ +/* file : mysql/assert.c -*- C -*- + * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd + * license : GPLv2 with Universal FOSS Exception; see accompanying LICENSE file + */ + +#include <mysql/my_config.h> + +#ifdef _MSC_VER +# include <windows.h> // C_ASSERT() +#endif + +#include <time.h> +#include <sys/types.h> + +/* + * Make sure that some assumptions made at the preprocessing stage are true. + */ + +/* + * _Static_assert() is introduced in C11, is supported by GCC and Clang for C99 + * as well, and is not supported by VC at all. + */ +#ifdef _MSC_VER +# define _Static_assert(C, M) C_ASSERT (C) +#endif + +_Static_assert (sizeof (off_t) == SIZEOF_OFF_T, "unexpected off_t size"); +_Static_assert (sizeof (time_t) == SIZEOF_TIME_T, "unexpected time_t size"); |