| sqltypes.h | | sqltypes.h | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| * Microsoft hardcoded a definition of unsigned short which may not be co
mpatible with | | * Microsoft hardcoded a definition of unsigned short which may not be co
mpatible with | |
| * your platform specific wide char definition. | | * your platform specific wide char definition. | |
| */ | | */ | |
| #include <wchar.h> | | #include <wchar.h> | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| | | /* | |
| | | * this is defined by configure, but will not be on a normal application bu | |
| | | ild | |
| | | */ | |
| | | | |
| | | #ifndef SIZEOF_LONG | |
| | | # if defined(__alpha) || defined(__sparcv9) | |
| | | # define SIZEOF_LONG 8 | |
| | | #else | |
| | | # define SIZEOF_LONG 4 | |
| | | #endif | |
| | | #endif | |
| | | | |
| /**************************** | | /**************************** | |
| * These make up for having no windows.h | | * These make up for having no windows.h | |
| ***************************/ | | ***************************/ | |
|
| | | #ifndef ALLREADY_HAVE_WINDOWS_TYPE | |
| | | | |
| #define FAR | | #define FAR | |
| #define CALLBACK | | #define CALLBACK | |
| #define SQL_API | | #define SQL_API | |
| #define BOOL int | | #define BOOL int | |
| typedef void* HWND; | | typedef void* HWND; | |
| typedef char CHAR; | | typedef char CHAR; | |
| #ifdef UNICODE | | #ifdef UNICODE | |
| | | | |
| /* | | /* | |
| * NOTE: The Microsoft unicode define is only for apps that want to use TCH
ARs and | | * NOTE: The Microsoft unicode define is only for apps that want to use TCH
ARs and | |
| | | | |
| skipping to change at line 78 | | skipping to change at line 92 | |
| | | | |
| #else | | #else | |
| typedef char TCHAR; | | typedef char TCHAR; | |
| #endif | | #endif | |
| | | | |
| #ifndef DONT_TD_VOID | | #ifndef DONT_TD_VOID | |
| typedef void VOID; | | typedef void VOID; | |
| #endif | | #endif | |
| | | | |
| typedef unsigned short WORD; | | typedef unsigned short WORD; | |
|
| | | #if (SIZEOF_LONG == 4) | |
| | | typedef unsigned long DWORD; | |
| | | #else | |
| typedef unsigned int DWORD; | | typedef unsigned int DWORD; | |
|
| | | #endif | |
| typedef unsigned char BYTE; | | typedef unsigned char BYTE; | |
| | | | |
| #ifdef SQL_WCHART_CONVERT | | #ifdef SQL_WCHART_CONVERT | |
| typedef wchar_t WCHAR; | | typedef wchar_t WCHAR; | |
| #else | | #else | |
| typedef unsigned short WCHAR; | | typedef unsigned short WCHAR; | |
| #endif | | #endif | |
| | | | |
| typedef WCHAR* LPWSTR; | | typedef WCHAR* LPWSTR; | |
| typedef const char* LPCSTR; | | typedef const char* LPCSTR; | |
| typedef TCHAR* LPTSTR; | | typedef TCHAR* LPTSTR; | |
| typedef char* LPSTR; | | typedef char* LPSTR; | |
| typedef DWORD* LPDWORD; | | typedef DWORD* LPDWORD; | |
| | | | |
| typedef void* HINSTANCE; | | typedef void* HINSTANCE; | |
| | | | |
|
| | | #endif | |
| | | | |
| /**************************** | | /**************************** | |
| * standard SQL* data types. use these as much as possible when using ODBC
calls/vars | | * standard SQL* data types. use these as much as possible when using ODBC
calls/vars | |
| ***************************/ | | ***************************/ | |
| typedef unsigned char SQLCHAR; | | typedef unsigned char SQLCHAR; | |
| | | | |
| #if (ODBCVER >= 0x0300) | | #if (ODBCVER >= 0x0300) | |
| typedef unsigned char SQLDATE; | | typedef unsigned char SQLDATE; | |
| typedef unsigned char SQLDECIMAL; | | typedef unsigned char SQLDECIMAL; | |
| typedef double SQLDOUBLE; | | typedef double SQLDOUBLE; | |
| typedef double SQLFLOAT; | | typedef double SQLFLOAT; | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
|
| * this is defined by configure, but will not be on a normal application bu | | | |
| ild | | | |
| */ | | | |
| | | | |
| #ifndef SIZEOF_LONG | | | |
| # if defined(__alpha) || defined(__sparcv9) | | | |
| # define SIZEOF_LONG 8 | | | |
| #else | | | |
| # define SIZEOF_LONG 4 | | | |
| #endif | | | |
| #endif | | | |
| | | | |
| /* | | | |
| * can't use a long it fails on 64 platforms | | * can't use a long it fails on 64 platforms | |
| */ | | */ | |
| | | | |
| /* | | /* | |
| * I (Nick) have made these changes, to cope with the new 3.52 MS | | * I (Nick) have made these changes, to cope with the new 3.52 MS | |
| * changes for 64 bit ODBC, but looking at MS's spec they havn't | | * changes for 64 bit ODBC, but looking at MS's spec they havn't | |
| * finished it themself. For example, SQLBindCol now expects the | | * finished it themself. For example, SQLBindCol now expects the | |
| * indicator variable to be a SQLLEN which then is a pointer to | | * indicator variable to be a SQLLEN which then is a pointer to | |
| * a 64 bit value. However the online book that comes with the | | * a 64 bit value. However the online book that comes with the | |
| * headers, then goes on to describe the indicator_ptr in the | | * headers, then goes on to describe the indicator_ptr in the | |
| | | | |
| skipping to change at line 145 | | skipping to change at line 153 | |
| * I have just discovered that on win64 sizeof(long) == 4, so its | | * I have just discovered that on win64 sizeof(long) == 4, so its | |
| * all smoke and mirrors... | | * all smoke and mirrors... | |
| * | | * | |
| */ | | */ | |
| | | | |
| #if (SIZEOF_LONG == 8) | | #if (SIZEOF_LONG == 8) | |
| #ifndef DO_YOU_KNOW_WHAT_YOUR_ARE_DOING | | #ifndef DO_YOU_KNOW_WHAT_YOUR_ARE_DOING | |
| typedef int SQLINTEGER; | | typedef int SQLINTEGER; | |
| typedef unsigned int SQLUINTEGER; | | typedef unsigned int SQLUINTEGER; | |
| #define SQLLEN SQLINTEGER | | #define SQLLEN SQLINTEGER | |
|
| #define SQLROWOFFSET SQLINTEGER | | | |
| #define SQLROWCOUNT SQLUINTEGER | | | |
| #define SQLULEN SQLUINTEGER | | #define SQLULEN SQLUINTEGER | |
|
| #define SQLTRANSID DWORD | | | |
| #define SQLSETPOSIROW SQLUSMALLINT | | #define SQLSETPOSIROW SQLUSMALLINT | |
| typedef SQLULEN SQLROWCOUNT; | | typedef SQLULEN SQLROWCOUNT; | |
| typedef SQLULEN SQLROWSETSIZE; | | typedef SQLULEN SQLROWSETSIZE; | |
| typedef SQLULEN SQLTRANSID; | | typedef SQLULEN SQLTRANSID; | |
| typedef SQLLEN SQLROWOFFSET; | | typedef SQLLEN SQLROWOFFSET; | |
| #else | | #else | |
| typedef int SQLINTEGER; | | typedef int SQLINTEGER; | |
| typedef unsigned int SQLUINTEGER; | | typedef unsigned int SQLUINTEGER; | |
| typedef long SQLLEN; | | typedef long SQLLEN; | |
| typedef unsigned long SQLULEN; | | typedef unsigned long SQLULEN; | |
| | | | |
| skipping to change at line 237 | | skipping to change at line 242 | |
| typedef SQLHANDLE HSTMT; | | typedef SQLHANDLE HSTMT; | |
| #else | | #else | |
| typedef void * HENV; | | typedef void * HENV; | |
| typedef void * HDBC; | | typedef void * HDBC; | |
| typedef void * HSTMT; | | typedef void * HSTMT; | |
| #endif | | #endif | |
| | | | |
| /**************************** | | /**************************** | |
| * more basic data types to augment what windows.h provides | | * more basic data types to augment what windows.h provides | |
| ***************************/ | | ***************************/ | |
|
| | | #ifndef ALLREADY_HAVE_WINDOWS_TYPE | |
| | | | |
| typedef unsigned char UCHAR; | | typedef unsigned char UCHAR; | |
| typedef signed char SCHAR; | | typedef signed char SCHAR; | |
| typedef SCHAR SQLSCHAR; | | typedef SCHAR SQLSCHAR; | |
| #if (SIZEOF_LONG == 4) | | #if (SIZEOF_LONG == 4) | |
| typedef long int SDWORD; | | typedef long int SDWORD; | |
| typedef unsigned long int UDWORD; | | typedef unsigned long int UDWORD; | |
| #else | | #else | |
| typedef int SDWORD; | | typedef int SDWORD; | |
| typedef unsigned int UDWORD; | | typedef unsigned int UDWORD; | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 261 | | skipping to change at line 268 | |
| typedef signed short SSHORT; | | typedef signed short SSHORT; | |
| typedef unsigned long ULONG; | | typedef unsigned long ULONG; | |
| typedef unsigned short USHORT; | | typedef unsigned short USHORT; | |
| typedef double SDOUBLE; | | typedef double SDOUBLE; | |
| typedef double LDOUBLE; | | typedef double LDOUBLE; | |
| typedef float SFLOAT; | | typedef float SFLOAT; | |
| typedef void* PTR; | | typedef void* PTR; | |
| typedef signed short RETCODE; | | typedef signed short RETCODE; | |
| typedef void* SQLHWND; | | typedef void* SQLHWND; | |
| | | | |
|
| | | #endif | |
| | | | |
| /**************************** | | /**************************** | |
| * standard structs for working with date/times | | * standard structs for working with date/times | |
| ***************************/ | | ***************************/ | |
| #ifndef __SQLDATE | | #ifndef __SQLDATE | |
| #define __SQLDATE | | #define __SQLDATE | |
| typedef struct tagDATE_STRUCT | | typedef struct tagDATE_STRUCT | |
| { | | { | |
| SQLSMALLINT year; | | SQLSMALLINT year; | |
| SQLUSMALLINT month; | | SQLUSMALLINT month; | |
| SQLUSMALLINT day; | | SQLUSMALLINT day; | |
| | | | |
| skipping to change at line 359 | | skipping to change at line 368 | |
| | | | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
| /**************************** | | /**************************** | |
| * | | * | |
| ***************************/ | | ***************************/ | |
| #if (ODBCVER >= 0x0300) | | #if (ODBCVER >= 0x0300) | |
| #if (SIZEOF_LONG == 8) | | #if (SIZEOF_LONG == 8) | |
|
| # define ODBCINT64 long | | # define ODBCINT64 long | |
| | | # define UODBCINT64 unsigned long | |
| #else | | #else | |
|
| # define ODBCINT64 long long | | # ifdef HAVE_LONG_LONG | |
| | | # define ODBCINT64 long long | |
| | | # define UODBCINT64 unsigned long long | |
| | | # else | |
| | | /* | |
| | | * may fail in some cases, but what else can we do ? | |
| | | */ | |
| | | struct __bigint_struct | |
| | | { | |
| | | int hiword; | |
| | | unsigned int loword; | |
| | | }; | |
| | | struct __bigint_struct_u | |
| | | { | |
| | | unsigned int hiword; | |
| | | unsigned int loword; | |
| | | }; | |
| | | # define ODBCINT64 struct __bigint_struct | |
| | | # define UODBCINT64 struct __bigint_struct_u | |
| | | # endif | |
| #endif | | #endif | |
| #ifdef ODBCINT64 | | #ifdef ODBCINT64 | |
| typedef ODBCINT64 SQLBIGINT; | | typedef ODBCINT64 SQLBIGINT; | |
|
| typedef unsigned ODBCINT64 SQLUBIGINT; | | #endif | |
| | | #ifdef UODBCINT64 | |
| | | typedef UODBCINT64 SQLUBIGINT; | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| /**************************** | | /**************************** | |
| * cursor and bookmark | | * cursor and bookmark | |
| ***************************/ | | ***************************/ | |
| #if (ODBCVER >= 0x0300) | | #if (ODBCVER >= 0x0300) | |
| #define SQL_MAX_NUMERIC_LEN 16 | | #define SQL_MAX_NUMERIC_LEN 16 | |
| typedef struct tagSQL_NUMERIC_STRUCT | | typedef struct tagSQL_NUMERIC_STRUCT | |
| { | | { | |
| SQLCHAR precision; | | SQLCHAR precision; | |
| SQLSCHAR scale; | | SQLSCHAR scale; | |
| SQLCHAR sign; /* 1=pos 0=neg */ | | SQLCHAR sign; /* 1=pos 0=neg */ | |
| SQLCHAR val[SQL_MAX_NUMERIC_LEN]; | | SQLCHAR val[SQL_MAX_NUMERIC_LEN]; | |
| } SQL_NUMERIC_STRUCT; | | } SQL_NUMERIC_STRUCT; | |
| #endif | | #endif | |
| | | | |
| #if (ODBCVER >= 0x0350) | | #if (ODBCVER >= 0x0350) | |
| #ifdef GUID_DEFINED | | #ifdef GUID_DEFINED | |
|
| | | #ifndef ALLREADY_HAVE_WINDOWS_TYPE | |
| typedef GUID SQLGUID; | | typedef GUID SQLGUID; | |
| #else | | #else | |
| typedef struct tagSQLGUID | | typedef struct tagSQLGUID | |
| { | | { | |
| DWORD Data1; | | DWORD Data1; | |
| WORD Data2; | | WORD Data2; | |
| WORD Data3; | | WORD Data3; | |
| BYTE Data4[ 8 ]; | | BYTE Data4[ 8 ]; | |
| } SQLGUID; | | } SQLGUID; | |
| #endif | | #endif | |
| #endif | | #endif | |
|
| | | #endif | |
| | | | |
| typedef SQLULEN BOOKMARK; | | typedef SQLULEN BOOKMARK; | |
| | | | |
| typedef WCHAR SQLWCHAR; | | typedef WCHAR SQLWCHAR; | |
| | | | |
| #ifdef UNICODE | | #ifdef UNICODE | |
| typedef SQLWCHAR SQLTCHAR; | | typedef SQLWCHAR SQLTCHAR; | |
| #else | | #else | |
| typedef SQLCHAR SQLTCHAR; | | typedef SQLCHAR SQLTCHAR; | |
| #endif | | #endif | |
| | | | |
End of changes. 15 change blocks. |
| 19 lines changed or deleted | | 52 lines changed or added | |
|