From 1fffde7667e8b2c63accc071935923f77b37ae09 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 17 Nov 2010 17:07:50 +0000 Subject: [PATCH] 2010-11-17 18:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbpgsql/postgres.c + Switched to built-in versioning macro instead of rolling our own. (not tested) --- harbour/ChangeLog | 7 ++++++- harbour/contrib/hbpgsql/postgres.c | 20 ++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d43ee337aa..bacf435d56 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2010-11-17 18:07 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbpgsql/postgres.c + + Switched to built-in versioning macro instead of rolling our own. + (not tested) + 2010-11-17 12:19 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbzebra/pdf417.c * harbour/contrib/hbzebra/code128.c @@ -190,7 +195,7 @@ ! Fixed to install all .hbc files inside the contrib dir structure. This is needed because now they exist also under '3rd' dirs, referenced from contrib .hbc files. - (lightly tested, will find out with next nightly) + (lightly tested, will find out with next nightly) [It's OK] * contrib/hbzebra/hbzebra.hbc ! Deleted no more needed reference to hbcairo.hbc diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 8e394614ba..824df7c1be 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -61,12 +61,8 @@ #include "postgres.h" #include "catalog/pg_type.h" -#ifndef HB_PGVERSION -# ifdef PG_DIAG_INTERNAL_POSITION -# define HB_PGVERSION 0x0800 -# else -# define HB_PGVERSION 0x0700 -# endif +#ifndef PG_VERSION_NUM +#define PG_VERSION_NUM 0 #endif static HB_GARBAGE_FUNC( PGconn_release ) @@ -153,7 +149,7 @@ static PGresult * hb_PGresult_par( int iParam ) return ph ? ( PGresult * ) * ph : NULL; } -#if HB_PGVERSION >= 0x0800 +#if PG_VERSION_NUM >= 80000 static HB_GARBAGE_FUNC( PGcancel_release ) { @@ -1127,7 +1123,7 @@ HB_FUNC( LO_UNLINK ) HB_FUNC( PQSERVERVERSION ) { -#if HB_PGVERSION >= 0x0800 +#if PG_VERSION_NUM >= 80000 PGconn * conn = hb_PGconn_par( 1 ); if( conn ) @@ -1141,7 +1137,7 @@ HB_FUNC( PQSERVERVERSION ) HB_FUNC( PQGETCANCEL ) { -#if HB_PGVERSION >= 0x0800 +#if PG_VERSION_NUM >= 80000 PGconn * conn = hb_PGconn_par( 1 ); if( conn ) @@ -1155,7 +1151,7 @@ HB_FUNC( PQGETCANCEL ) HB_FUNC( PQCANCEL ) { -#if HB_PGVERSION >= 0x0800 +#if PG_VERSION_NUM >= 80000 PGcancel * cancel = hb_PGcancel_par( 1 ); if( cancel ) @@ -1181,7 +1177,7 @@ HB_FUNC( PQCANCEL ) /* NOTE: Deprecated */ HB_FUNC( PQFREECANCEL ) { -#if HB_PGVERSION >= 0x0800 +#if PG_VERSION_NUM >= 80000 void ** ph = ( void ** ) hb_parptrGC( &s_gcPGcancelFuncs, 1 ); /* Check if pointer is not NULL to avoid multiple freeing */ @@ -1200,7 +1196,7 @@ HB_FUNC( PQFREECANCEL ) HB_FUNC( PQESCAPEBYTEACONN ) { -#if HB_PGVERSION >= 0x0800 +#if PG_VERSION_NUM >= 80000 PGconn * conn = hb_PGconn_par( 1 ); if( conn && HB_ISCHAR( 2 ) )