FreeTDS API: include/tds_sysdep_private.h Source File

Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

# tds_sysdep_private.h

    00001 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
    00002  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004  Brian Bruns
    00003  *
    00004  * This library is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU Library General Public
    00006  * License as published by the Free Software Foundation; either
    00007  * version 2 of the License, or (at your option) any later version.
    00008  *
    00009  * This library is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012  * Library General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Library General Public
    00015  * License along with this library; if not, write to the
    00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017  * Boston, MA 02111-1307, USA.
    00018  */
    00019
    00020 #ifndef _tds_sysdep_private_h_
    00021 #define _tds_sysdep_private_h_
    00022
    00023 #undef TDS_RCSID
    00024 #if defined(__GNUC__) && __GNUC__ >= 3
    00025 #define TDS_RCSID(name, id) \
    00026         static const char rcsid_##name[] __attribute__ ((unused)) = id
    00027 #else
    00028 #define TDS_RCSID(name, id) \
    00029         static const char rcsid_##name[] = id; \
    00030         static const void *const no_unused_##name##_warn[] = { rcsid_##name, no_unused_##name##_warn }
    00031 #endif
    00032
    00033 TDS_RCSID(tds_sysdep_private_h, "$Id: tds_sysdep_private.h,v 1.19 2005/10/07 10:23:45 freddy77 Exp $");
    00034
    00035 #define TDS_ADDITIONAL_SPACE 0
    00036
    00037 #ifdef __cplusplus
    00038 extern "C"
    00039 {
    00040 #if 0
    00041 }
    00042 #endif
    00043 #endif
    00044
    00045 #ifdef __INCvxWorksh
    00046 #include <ioLib.h>              /* for FIONBIO */
    00047 #endif                          /* __INCvxWorksh */
    00048
    00049 #if defined(DOS32X)
    00050 #define READSOCKET(a,b,c)       recv((a), (b), (c), 0L)
    00051 #define WRITESOCKET(a,b,c)      send((a), (b), (c), 0L)
    00052 #define CLOSESOCKET(a)          closesocket((a))
    00053 #define IOCTLSOCKET(a,b,c)      ioctlsocket((a), (b), (char*)(c))
    00054 #define select select_s
    00055 typedef int pid_t;
    00056 #define strcasecmp stricmp
    00057 #define strncasecmp strnicmp
    00058 #define vsnprintf _vsnprintf
    00059 /* TODO this has nothing to do with ip ... */
    00060 #define getpid() _gethostid()
    00061 #endif  /* defined(DOS32X) */
    00062
    00063 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
    00064 #include <windows.h>
    00065 #define READSOCKET(a,b,c)       recv((a), (b), (c), 0L)
    00066 #define WRITESOCKET(a,b,c)      send((a), (b), (c), 0L)
    00067 #define CLOSESOCKET(a)          closesocket((a))
    00068 #define IOCTLSOCKET(a,b,c)      ioctlsocket((a), (b), (c))
    00069 #define NETDB_REENTRANT 1       /* BSD-style netdb interface is reentrant */
    00070
    00071 #define TDSSOCK_EINTR WSAEINTR
    00072 #define TDSSOCK_EINPROGRESS WSAEWOULDBLOCK
    00073 #define sock_errno WSAGetLastError()
    00074 #ifndef __MINGW32__
    00075 typedef DWORD pid_t;
    00076 #endif
    00077 #define strcasecmp stricmp
    00078 #define strncasecmp strnicmp
    00079 #define atoll _atoi64
    00080 #define vsnprintf _vsnprintf
    00081
    00082 #ifndef WIN32
    00083 #define WIN32 1
    00084 #endif
    00085
    00086 #define TDS_SDIR_SEPARATOR "\\"
    00087
    00088 #endif /* defined(WIN32) || defined(_WIN32) || defined(__WIN32__) */
    00089
    00090 #ifndef sock_errno
    00091 #define sock_errno errno
    00092 #endif
    00093
    00094 #ifndef TDSSOCK_EINTR
    00095 #define TDSSOCK_EINTR EINTR
    00096 #endif
    00097
    00098 #ifndef TDSSOCK_EINPROGRESS
    00099 #define TDSSOCK_EINPROGRESS EINPROGRESS
    00100 #endif
    00101
    00102 #ifndef READSOCKET
    00103 #define READSOCKET(a,b,c)       read((a), (b), (c))
    00104 #endif /* !READSOCKET */
    00105
    00106 #ifndef WRITESOCKET
    00107 #define WRITESOCKET(a,b,c)      write((a), (b), (c))
    00108 #endif /* !WRITESOCKET */
    00109
    00110 #ifndef CLOSESOCKET
    00111 #define CLOSESOCKET(a)          close((a))
    00112 #endif /* !CLOSESOCKET */
    00113
    00114 #ifndef IOCTLSOCKET
    00115 #define IOCTLSOCKET(a,b,c)      ioctl((a), (b), (c))
    00116 #endif /* !IOCTLSOCKET */
    00117
    00118 #ifndef TDS_SDIR_SEPARATOR
    00119 #define TDS_SDIR_SEPARATOR "/"
    00120 #endif /* !TDS_SDIR_SEPARATOR */
    00121
    00122 #ifdef __cplusplus
    00123 #if 0
    00124 {
    00125 #endif
    00126 }
    00127 #endif
    00128
    00129 #endif /* _tds_sysdep_private_h_ */