mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Support --disable-glib flag with ODBC driver
This commit is contained in:
@@ -51,7 +51,7 @@ extern int SQLGetPrivateProfileString( LPCSTR lpszSection,
|
||||
int cbRetBuffer,
|
||||
LPCSTR lpszFilename);
|
||||
#else
|
||||
static GString* GetIniFileName ();
|
||||
static GString* GetIniFileName (void);
|
||||
static int FileExists (const gchar* name);
|
||||
static int FindSection (FILE* stream, const char* section);
|
||||
static int GetNextItem (FILE* stream, char** name, char** value);
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
#ifndef _connectparams_h_
|
||||
#define _connectparams_h_
|
||||
|
||||
#ifdef HAVE_GLIB
|
||||
#include <glib.h>
|
||||
#else
|
||||
#include <mdbfakeglib.h>
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -28,7 +32,7 @@ typedef struct
|
||||
GHashTable* table;
|
||||
} ConnectParams;
|
||||
|
||||
ConnectParams* NewConnectParams ();
|
||||
ConnectParams* NewConnectParams (void);
|
||||
void FreeConnectParams (ConnectParams* params);
|
||||
|
||||
gboolean LookupDSN (ConnectParams* params, const gchar* dsnName);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <sqlext.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include "mdbodbc.h"
|
||||
|
||||
//#define TRACE(x) fprintf(stderr,"Function %s\n", x);
|
||||
@@ -101,7 +102,7 @@ TypeInfo type_info[] = {
|
||||
#define MAX_TYPE_INFO 11
|
||||
|
||||
#ifdef ENABLE_ODBC_W
|
||||
void my_fini();
|
||||
void my_fini(void);
|
||||
|
||||
MDB_CONSTRUCTOR(my_init)
|
||||
{
|
||||
@@ -784,7 +785,7 @@ static SQLRETURN SQL_API _SQLDescribeCol(
|
||||
strcpy(sqlState, "HY090"); // Invalid string or buffer length
|
||||
return SQL_ERROR;
|
||||
}
|
||||
if (snprintf(szColName, cbColNameMax, "%s", sqlcol->name) + 1 > cbColNameMax) {
|
||||
if (snprintf((char *)szColName, cbColNameMax, "%s", sqlcol->name) + 1 > cbColNameMax) {
|
||||
strcpy(sqlState, "01004"); // String data, right truncated
|
||||
ret = SQL_SUCCESS_WITH_INFO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user