FreeTDS API

Loading...
Searching...
No Matches
ct_checks.h
1#include <config.h>
2
3#include "ctpublic.h"
4#include "ctlib.h"
5
6#define TDS_ATTR(field_name) \
7 (sizeof(((STRUCTUREA*)0)->field_name) == sizeof(((STRUCTUREB*)0)->FIELDB field_name) && \
8 TDS_OFFSET(STRUCTUREA,field_name) == TDS_OFFSET(STRUCTUREB,FIELDB field_name))
9
10#define TDS_DATAFMT_TEST(test_name) TDS_COMPILE_CHECK(check_ ## test_name,\
11 TDS_ATTR(name) &&\
12 TDS_ATTR(namelen) &&\
13 TDS_ATTR(datatype) &&\
14 TDS_ATTR(format) &&\
15 TDS_ATTR(maxlength) &&\
16 TDS_ATTR(scale) &&\
17 TDS_ATTR(precision) &&\
18 TDS_ATTR(status) &&\
19 TDS_ATTR(count) &&\
20 TDS_ATTR(usertype) &&\
21 TDS_ATTR(locale))
22
23#define TDS_SERVERMSG_TEST(test_name) TDS_COMPILE_CHECK(check_ ## test_name,\
24 TDS_ATTR(msgnumber) &&\
25 TDS_ATTR(state) &&\
26 TDS_ATTR(severity) &&\
27 TDS_ATTR(text) &&\
28 TDS_ATTR(textlen) &&\
29 TDS_ATTR(svrname) &&\
30 TDS_ATTR(svrnlen) &&\
31 TDS_ATTR(proc) &&\
32 TDS_ATTR(proclen) &&\
33 TDS_ATTR(line) &&\
34 TDS_ATTR(status) &&\
35 TDS_ATTR(sqlstate) &&\
36 TDS_ATTR(sqlstatelen))