Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteeec317

Browse files
committed
Determines the PKGLIBDIR equivalent under win32. Requires pgsql lib and
bin directories to be packaged under the same root directory (eg. <somepath>/pgsql/bin and <some path>/pgsql/lib) for the win32 port, whichdoes not appear to be an onerous restriction.Claudio Natoli
1 parent943eae9 commiteeec317

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

‎src/backend/utils/fmgr/dfmgr.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.70 2004/02/17 03:35:57 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.71 2004/03/09 05:06:45 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -343,6 +343,9 @@ substitute_libpath_macro(const char *name)
343343
{
344344
size_tmacroname_len;
345345
char*replacement=NULL;
346+
#ifdefWIN32
347+
charbasename[MAXPGPATH];
348+
#endif
346349

347350
AssertArg(name!=NULL);
348351

@@ -356,7 +359,26 @@ substitute_libpath_macro(const char *name)
356359
#endif
357360

358361
if (strncmp(name,"$libdir",macroname_len)==0)
362+
#ifndefWIN32
359363
replacement=PKGLIBDIR;
364+
#else
365+
{
366+
char*p;
367+
if (GetModuleFileName(NULL,basename,MAXPGPATH)==0)
368+
ereport(FATAL,
369+
(errmsg("GetModuleFileName failed (%i)",(int)GetLastError())));
370+
371+
canonicalize_path(basename);
372+
if ((p=last_path_separator(basename))==NULL)
373+
ereport(FATAL,
374+
(errmsg("unexpected failure in determining PKGLIBDIR (%s)",basename)));
375+
else
376+
*p='\0';
377+
378+
strcat(basename,"/../lib");
379+
replacement=basename;
380+
}
381+
#endif
360382
else
361383
ereport(ERROR,
362384
(errcode(ERRCODE_INVALID_NAME),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp