]> granicus.if.org Git - postgresql/commitdiff
Make libpq++ safe again for older C++ compilers. Do 'using namespace std'
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 30 Sep 2001 22:30:37 +0000 (22:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 30 Sep 2001 22:30:37 +0000 (22:30 +0000)
only if configure found it was safe to do so; do not assume const_cast
is available.

src/interfaces/libpq++/pgconnection.cc
src/interfaces/libpq++/pgconnection.h
src/interfaces/libpq++/pgcursordb.cc
src/interfaces/libpq++/pgcursordb.h
src/interfaces/libpq++/pgdatabase.cc
src/interfaces/libpq++/pglobject.cc
src/interfaces/libpq++/pglobject.h

index 2f10264deaaf801584266d9922de7b4fb2f06df3..11db62c28679cfda1cd899de16f5e542b0466964 100644 (file)
  * Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgconnection.cc,v 1.11 2001/05/09 17:29:10 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgconnection.cc,v 1.12 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 #include "pgconnection.h"
 
+#ifdef HAVE_NAMESPACE_STD
 using namespace std;
+#endif
 
 
 // ****************************************************************
index 7d8ca2c52bfc18b39b3691cfc8a6e08c749cc310..217006f3b72a03a5f7aff38eb0b771a08f528b26 100644 (file)
@@ -13,7 +13,7 @@
  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  * 
- * $Id: pgconnection.h,v 1.13 2001/08/24 14:07:49 petere Exp $
+ * $Id: pgconnection.h,v 1.14 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -96,9 +96,6 @@ private:
 };
 
 
-#ifdef HAVE_NAMESPACE_STD
 #undef PGSTD
-#endif
-
 
 #endif // PGCONNECTION_H
index 369bc15f6e0602df1ed6c9174451897f7ddf983b..585428ddfb1433cb6a139fd539fbeea28b71ffe4 100644 (file)
  * Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgcursordb.cc,v 1.5 2001/05/09 17:29:10 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgcursordb.cc,v 1.6 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
  
 #include "pgcursordb.h"
  
-
+#ifdef HAVE_NAMESPACE_STD
 using namespace std;
+#endif
 
 
 // ****************************************************************
index 07a148f1dcb1e53f98cf5501d6e851976a95add9..7dca828ce1ac8b22b60e4ffb4e79e675cb8fc346 100644 (file)
@@ -14,7 +14,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
- *  $Id: pgcursordb.h,v 1.8 2001/07/11 22:12:43 momjian Exp $
+ *  $Id: pgcursordb.h,v 1.9 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -78,9 +78,7 @@ private:
 }; // End PgCursor Class Declaration
 
 
-#ifdef HAVE_NAMESPACE_STD
 #undef PGSTD
-#endif
 
 #endif // PGCURSORDB_H
 
index 72cec48cf2ff6dd30089ddfbc1caa3cef46c5097..fe1face88daafad9cabb28690f52213a003605d8 100644 (file)
  * Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.11 2001/05/09 17:46:11 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.12 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
  
 #include "pgdatabase.h"
 
-
+#ifdef HAVE_NAMESPACE_STD
 using namespace std;
+#endif
 
 
 // OBSOLESCENT (uses PQprint(), which is no longer being maintained)
@@ -33,7 +34,7 @@ void PgDatabase::DisplayTuples(FILE *out,
        po.header = printHeader;
        po.align = fillAlign;
        po.standard = po.html3 = po.expanded = po.pager = 0;
-       po.fieldSep = const_cast<char *>(fieldSep);
+       po.fieldSep = (char *) (fieldSep);
        po.tableOpt = po.caption = 0;
        po.fieldName = 0;
 
@@ -54,7 +55,7 @@ void PgDatabase::PrintTuples(FILE *out,
        po.align = fillAlign;
        po.standard = po.html3 = po.expanded = po.pager = 0;
        po.tableOpt = po.caption = 0;
-       po.fieldSep = const_cast<char *>(terseOutput ? "" : "|");
+       po.fieldSep = (char *) (terseOutput ? "" : "|");
        po.fieldName = 0;
 
        PQprint(out,pgResult,&po);
index 0523ec8f91a08a16c206cd98ee667c90ca91b50a..6bf5e304438646d4c27ed052f85563698a135caa 100644 (file)
@@ -10,7 +10,7 @@
  * Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pglobject.cc,v 1.7 2001/05/09 17:29:10 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pglobject.cc,v 1.8 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -21,8 +21,9 @@ extern "C" {
 #include "libpq/libpq-fs.h"
 }
 
-
+#ifdef HAVE_NAMESPACE_STD
 using namespace std;
+#endif
 
 
 // ****************************************************************
index 0f094d267611910dc96c734f3dd8c91833662bd7..7752e1dd65470cd32828d933818e4931320d619c 100644 (file)
@@ -11,7 +11,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
- *  $Id: pglobject.h,v 1.8 2001/07/11 22:12:43 momjian Exp $
+ *  $Id: pglobject.h,v 1.9 2001/09/30 22:30:37 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -68,9 +68,6 @@ private:
 };
 
 
-#ifdef HAVE_NAMESPACE_STD
 #undef PGSTD
-#endif
-
 
 #endif // PGLOBJECT_H