aboutsummaryrefslogtreecommitdiff
path: root/mysql/libmysql/assert.c
blob: e11db5b44b86548b420d412cda7006294043601c (plain)
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
/* file      : mysql/libmysql/assert.c -*- C -*-
 * copyright : Copyright (c) 2016-2017 Code Synthesis Ltd
 * license   : GPLv2 with FOSS License Exception; see accompanying COPYING 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");