Modifications to allow compilation under windows

git-svn-id: http://svn.osgeo.org/qgis/trunk@1603 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2004-06-17 04:27:07 +00:00
parent bf22f75eab
commit 48b01324d1
2 changed files with 32 additions and 4 deletions

23
providers/postgres/postgres.pro Executable file
View File

@ -0,0 +1,23 @@
######################################################################
Qmake project file for building the postgres provider.
This file is needed for building on Windows
######################################################################
# postgres.pro,v 1.1 2004/06/17 04:27:07 gsherman Exp
TEMPLATE = lib
INCLUDEPATH += . \
C:\Development\qgis_win32\src \
C:\Development\postgresql-7.4.3\src\interfaces\libpq \
C:\Development\postgresql-7.4.3\src\include
LIBS += C:\Development\postgresql-7.4.3\src\interfaces\libpq\Release\libpq.lib
CONFIG += qt dll thread
DLLDESTDIR= ..\..\src\lib\qgis
# Input
HEADERS += qgspostgresprovider.h
SOURCES += qgspostgresprovider.cpp \
..\..\src\qgsfeature.cpp \
..\..\src\qgsfield.cpp \
..\..\src\qgsrect.cpp \
..\..\src\qgsfeatureattribute.cpp \
..\..\src\qgspoint.cpp

View File

@ -28,6 +28,11 @@
#include "../../src/qgsrect.h"
#include "qgspostgresprovider.h"
#ifdef WIN32
#define QGISEXTERN extern "C" __declspec( dllexport )
#else
#define QGISEXTERN extern "C"
#endif
QgsPostgresProvider::QgsPostgresProvider(QString uri):dataSourceUri(uri)
{
// assume this is a valid layer until we determine otherwise
@ -723,25 +728,25 @@ QString QgsPostgresProvider::postgisVersion(PGconn *connection){
* Class factory to return a pointer to a newly created
* QgsPostgresProvider object
*/
extern "C" QgsPostgresProvider * classFactory(const char *uri)
QGISEXTERN QgsPostgresProvider * classFactory(const char *uri)
{
return new QgsPostgresProvider(uri);
}
/** Required key function (used to map the plugin to a data store type)
*/
extern "C" QString providerKey(){
QGISEXTERN QString providerKey(){
return QString("postgres");
}
/**
* Required description function
*/
extern "C" QString description(){
QGISEXTERN QString description(){
return QString("PostgreSQL/PostGIS data provider");
}
/**
* Required isProvider function. Used to determine if this shared library
* is a data provider plugin
*/
extern "C" bool isProvider(){
QGISEXTERN bool isProvider(){
return true;
}