RE: [INTERFACES] The problem between libpq and libpgtcl for WIN32

From: "Hiroki Kataoka" <kataoka(at)interwiz(dot)koganei(dot)tokyo(dot)jp>
To: "pgsql-interfaces" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: RE: [INTERFACES] The problem between libpq and libpgtcl for WIN32
Date: 1998-12-21 14:44:56
Message-ID: 000001be2cf0$7a5c6000$44c9e6ca@suzume.interwiz.koganei.tokyo.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hello all.

> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue(at)tpf(dot)co(dot)jp]
>
> Hi all.
>
::
>
> The word _declspec(dllimport) is Microsoft-specific and other compilers
> can't handle this keyword ?
>
> Magnus, libpq for WIN32 is only for Microsoft Visual C++ ?
> (Seems makefiles win32.mak are for Microsoft Visual C++).

I think that the source code assumes Microsoft Visual C++ is used at the
compilation time of libpq. But it is general at using libpq from another
application.

> For this problem,Tom Lane wrote
>
> > But it seems reasonable to add a corresponding function call, say
> >
> > const char * PQresStatus (ExecStatusType status);
> >
> > and change libpgtcl to use that instead. We could even deprecate
>
> I agree with him because I don't like global data references.

I agree with the addition of PQresStatus API.

> But the way Hiroki proposed has a advantage that binaries(libpq,libpgtcl)
> are invariant except the dll's for WIN32.

I prepared another different method though looked like. But, I think that
this method does not depend on MS VC++. I want someone to try in the
environments other than MS VC++.

======== cut here ========
*** libpq-fe.h.dist Tue Oct 6 23:16:48 1998
--- libpq-fe.h Mon Dec 21 22:42:58 1998
***************
*** 50,56 ****
--- 50,61 ----
} ExecStatusType;

/* String descriptions of the ExecStatusTypes */
+ #ifdef WIN32
+ extern const char * const (* _imp_pgresStatus)[];
+ #define pgresStatus (* _imp_pgresStatus)
+ #else
extern const char * const pgresStatus[];
+ #endif

/* PGconn encapsulates a connection to the backend.
* The contents of this struct are not supposed to be known to
applications.
*** libpqdll.def.dist Tue Oct 6 23:05:02 1998
--- libpqdll.def Mon Dec 21 22:38:06 1998
***************
*** 63,68 ****
lo_unlink @ 60
lo_import @ 61
lo_export @ 62
! pgresStatus @ 63
PQmblen @ 64
PQresultErrorMessage @ 65
--- 63,68 ----
lo_unlink @ 60
lo_import @ 61
lo_export @ 62
! pgresStatus @ 63 DATA
PQmblen @ 64
PQresultErrorMessage @ 65
======== cut here ========

I do not think that my idea is final. However, I think that we can port
the code of UNIX easily to the environment of WIN32 in this method.

Thank you.

--
Hiroki Kataoka
kataoka(at)interwiz(dot)koganei(dot)tokyo(dot)jp

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Roman A.Potvorov 1998-12-22 01:57:48 Upper case chars in view name.
Previous Message Oliver Matz 1998-12-20 01:26:12 RedHat5.2 - postgres 6.4 - jdbc - Problems