Re: Relocatable locale

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Relocatable locale
Date: 2004-05-27 13:03:57
Message-ID: 200405271303.i4RD3vk12487@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Peter Eisentraut wrote:
> Am Donnerstag, 27. Mai 2004 14:41 schrieb Bruce Momjian:
> > > > As for how to do it - on Windows you *can* get the path of the DLL that
> > > > is executing your code, using GetModuleFileName(). Hardly
> > > > cross-platform, but can be done.
> > >
> > > That sounds pretty reasonable to me.
> >
> > True, and we already have our own find_my_exec() which works for Unix too.
>
> What does that have to do with this case? We're trying to find the library
> here.

Oh, I see that GetModuleFileName() finds the location of your library,
not of the binary. Nice. So, for Win32, we use that function call to
find the locale directory?

We do have a comment in port/exec.c:

if (GetModuleFileName(NULL, retpath, MAXPGPATH) == 0)

and I thought that did only binaries, not the library that uses them. I
assume if the library is a DLL, it returns the DLL location, and if it
is in the binary, it returns the binary location.

I will make a Win32-specific patch. Do we want an evironment variable
for Unix? Seems folks do. I will work on that too.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-05-27 13:07:50 Re: pg_ctl.c
Previous Message Peter Eisentraut 2004-05-27 12:54:17 Re: Relocatable locale