Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4051bce

Browse files
committed
Libpq++ fixes for Win32 compile.
Christian Ullrich
1 parent d674b48 commit 4051bce

File tree

8 files changed

+23
-12
lines changed

8 files changed

+23
-12
lines changed

src/include/c.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.96 2001/07/03 20:21:50 petere Exp $
15+
* $Id: c.h,v 1.97 2001/07/11 22:12:43 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -615,7 +615,13 @@ typedef NameData *Name;
615615
#else /* not BUILDING_DLL */
616616
#define DLLIMPORT __declspec (dllimport)
617617
#endif
618-
#else /* not CYGWIN */
618+
#elif defined(WIN32) && defined(_MSC_VER) /* not CYGWIN */
619+
#if defined(_DLL)
620+
#define DLLIMPORT __declspec (dllexport)
621+
#else /* not _DLL */
622+
#define DLLIMPORT __declspec (dllimport)
623+
#endif
624+
#else /* not CYGWIN, not MSVC */
619625
#define DLLIMPORT
620626
#endif
621627

src/include/config.h.win32

+3
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020

2121
#define HAVE_ATEXIT
2222
#define HAVE_MEMMOVE
23+
24+
#define HAVE_CXX_STRING_HEADER
25+
#define HAVE_NAMESPACE_STD

src/interfaces/libpq++/pgconnection.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
16-
* $Id: pgconnection.h,v 1.11 2001/05/09 17:29:10 momjian Exp $
16+
* $Id: pgconnection.h,v 1.12 2001/07/11 22:12:43 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -57,7 +57,7 @@ extern "C" {
5757
// This class contains all the information about the connection
5858
// to the backend process. All the database classes should be
5959
// derived from this class to obtain the connection interface.
60-
class PgConnection {
60+
class DLLIMPORT PgConnection {
6161
protected:
6262
PGconn* pgConn; // Connection Structure
6363
PGresult* pgResult; // Current Query Result

src/interfaces/libpq++/pgcursordb.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
1616
*
17-
* $Id: pgcursordb.h,v 1.7 2001/05/09 17:29:10 momjian Exp $
17+
* $Id: pgcursordb.h,v 1.8 2001/07/11 22:12:43 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -42,7 +42,7 @@
4242
// manipulates data through it. The interface will introduce some
4343
// ease of use through the methods that will allow cursor specific
4444
// operations, like fetch, forward, etc.
45-
class PgCursor : public PgTransaction {
45+
class DLLIMPORT PgCursor : public PgTransaction {
4646
public:
4747
PgCursor(const char* conninfo, const char* cursor); // use reasonable & environment defaults
4848
// connect to the database with given environment and database name

src/interfaces/libpq++/pgdatabase.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
1616
*
17-
* $Id: pgdatabase.h,v 1.11 2001/05/09 17:46:11 momjian Exp $
17+
* $Id: pgdatabase.h,v 1.12 2001/07/11 22:12:43 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -34,7 +34,7 @@
3434
// This is the basic database access class. Its interface should
3535
// be used only after a query has been sent to the backend and
3636
// results are being received.
37-
class PgDatabase : public PgConnection {
37+
class DLLIMPORT PgDatabase : public PgConnection {
3838
public:
3939
// connect to the database with conninfo
4040
explicit PgDatabase(const char* conninfo) : PgConnection(conninfo) {}

src/interfaces/libpq++/pglobject.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
*
14-
* $Id: pglobject.h,v 1.7 2001/05/09 17:29:10 momjian Exp $
14+
* $Id: pglobject.h,v 1.8 2001/07/11 22:12:43 momjian Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -35,7 +35,7 @@
3535
// PgLargeObject - a class for accessing Large Object in a database
3636
//
3737
// ****************************************************************
38-
class PgLargeObject : public PgConnection {
38+
class DLLIMPORT PgLargeObject : public PgConnection {
3939
private:
4040
int pgFd;
4141
Oid pgObject;

src/interfaces/libpq++/pgtransdb.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
1616
*
17-
* $Id: pgtransdb.h,v 1.7 2001/05/09 17:29:10 momjian Exp $
17+
* $Id: pgtransdb.h,v 1.8 2001/07/11 22:12:43 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -34,7 +34,7 @@
3434
// This is the database access class that keeps an open
3535
// transaction block during its lifetime. The block is ENDed when
3636
// the object is destroyed.
37-
class PgTransaction : public PgDatabase {
37+
class DLLIMPORT PgTransaction : public PgDatabase {
3838
public:
3939
explicit PgTransaction(const char* conninfo); // use reasonable & environment defaults
4040
// connect to the database with given environment and database name

src/win32.mak

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ ALL:
2020
cd ..
2121
cd interfaces\libpq
2222
nmake /f win32.mak $(MAKEMACRO)
23+
cd ..\libpq++
24+
nmake /f win32.mak $(MAKEMACRO)
2325
cd ..\..\bin\psql
2426
nmake /f win32.mak $(MAKEMACRO)
2527
cd ..\..

0 commit comments

Comments
 (0)