FreeTDS API
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tds_sysdep_public.h
1 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
2  * Copyright (C) 1998-1999 Brian Bruns
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 #ifndef _tds_sysdep_public_h_
21 #define _tds_sysdep_public_h_
22 
23 /* $Id: tds_sysdep_public.h.in,v 1.11.2.1 2008/01/23 08:50:16 freddy77 Exp $ */
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 /*
31 ** This is where platform-specific changes need to be made.
32 */
33 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
34 #include <windows.h>
35 #define tds_sysdep_int16_type short /* 16-bit int */
36 #define tds_sysdep_int32_type int /* 32-bit int */
37 #define tds_sysdep_int64_type __int64 /* 64-bit int */
38 #define tds_sysdep_real32_type float /* 32-bit real */
39 #define tds_sysdep_real64_type double /* 64-bit real */
40 #if !defined(WIN64) && !defined(_WIN64)
41 #define tds_sysdep_intptr_type int /* 32-bit int */
42 #else
43 #define tds_sysdep_intptr_type __int64 /* 64-bit int */
44 #endif
45 #endif /* defined(WIN32) || defined(_WIN32) || defined(__WIN32__) */
46 
47 #ifndef tds_sysdep_int16_type
48 #define tds_sysdep_int16_type short /* 16-bit int */
49 #endif /* !tds_sysdep_int16_type */
50 
51 #ifndef tds_sysdep_int32_type
52 #define tds_sysdep_int32_type int /* 32-bit int */
53 #endif /* !tds_sysdep_int32_type */
54 
55 #ifndef tds_sysdep_int64_type
56 #define tds_sysdep_int64_type long /* 64-bit int */
57 #endif /* !tds_sysdep_int64_type */
58 
59 #ifndef tds_sysdep_real32_type
60 #define tds_sysdep_real32_type float /* 32-bit real */
61 #endif /* !tds_sysdep_real32_type */
62 
63 #ifndef tds_sysdep_real64_type
64 #define tds_sysdep_real64_type double /* 64-bit real */
65 #endif /* !tds_sysdep_real64_type */
66 
67 #ifndef tds_sysdep_intptr_type
68 #define tds_sysdep_intptr_type long
69 #endif /* !tds_sysdep_intptr_type */
70 
71 #if !defined(__WIN32__) && !defined(_WIN32) && !defined(WIN32)
72 typedef int TDS_SYS_SOCKET;
73 #define INVALID_SOCKET -1
74 #define TDS_IS_SOCKET_INVALID(s) ((s) < 0)
75 #else
76 typedef SOCKET TDS_SYS_SOCKET;
77 #define TDS_IS_SOCKET_INVALID(s) ((s) == INVALID_SOCKET)
78 #endif
79 
80 #if !defined(MSDBLIB) && !defined(SYBDBLIB)
81 #define MSDBLIB 1
82 #endif
83 #if defined(MSDBLIB) && defined(SYBDBLIB)
84 #error MSDBLIB and SYBDBLIB cannot both be defined
85 #endif
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* _tds_sysdep_public_h_ */