aboutsummaryrefslogtreecommitdiff
path: root/odb/mssql/mssql-fwd.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/mssql/mssql-fwd.hxx')
-rw-r--r--odb/mssql/mssql-fwd.hxx60
1 files changed, 60 insertions, 0 deletions
diff --git a/odb/mssql/mssql-fwd.hxx b/odb/mssql/mssql-fwd.hxx
index 3579403..20acab3 100644
--- a/odb/mssql/mssql-fwd.hxx
+++ b/odb/mssql/mssql-fwd.hxx
@@ -93,6 +93,66 @@ typedef SQLHANDLE SQLHDESC;
# define SQL_HANDLE_DESC 4
#endif
+// The following types are our own equivalents of ODBC and Native Client
+// ODBC driver types. They are all PODs and should be layout-compatible
+// with the original types, which means they can be used interchangeably.
+//
+namespace odb
+{
+ namespace mssql
+ {
+ // UCS-2 character type (SQLWCHAR).
+ //
+#ifdef _WIN32
+ typedef wchar_t ucs2_char;
+#else
+ typedef unsigned short ucs2_char;
+#endif
+
+ // SQL_NUMERIC_STRUCT
+ //
+#ifndef SQL_MAX_NUMERIC_LEN
+#define SQL_MAX_NUMERIC_LEN 16
+#else
+# if SQL_MAX_NUMERIC_LEN != 16
+# error unexpected SQL_NUMERIC_STRUCT value
+# endif
+#endif
+
+ struct decimal
+ {
+ unsigned char precision;
+ signed char scale;
+ unsigned char sign; // 1 - positive, 0 - negative
+ unsigned char val[SQL_MAX_NUMERIC_LEN];
+ };
+
+ // DBMONEY
+ //
+ struct money
+ {
+ // 8-byte signed integer containing value * 10,000.
+ //
+ int high;
+ unsigned int low;
+ };
+
+ // DBMONEY4
+ //
+ struct smallmoney
+ {
+ int value; // 4-byte signed integer containing value * 10,000.
+ };
+
+ //@@ TODO
+ //
+ struct date {};
+ struct time {};
+ struct datetime {};
+ struct datetimeoffset {};
+ }
+}
+
#include <odb/post.hxx>
#endif // ODB_MSSQL_MSSQL_FWD_HXX