Re: Autoconf, libpq and replacement function

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Autoconf, libpq and replacement function
Date: 2008-11-20 20:50:31
Message-ID: 4925CD97.3050000@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> *** a/src/include/port.h
>> --- b/src/include/port.h
>> ***************
>> *** 393,398 **** extern void unsetenv(const char *name);
>> --- 393,409 ----
>> extern void srandom(unsigned int seed);
>> #endif
>
>> + #ifdef HAVE_FNMATCH
>> + extern int fnmatch(const char *, const char *, int);
>> + #define FNM_NOMATCH 1 /* Match failed. */
>> + #define FNM_NOSYS 2 /* Function not implemented. */
>> + #define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
>> + #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
>> + #define FNM_PERIOD 0x04 /* Period must be matched by period. */
>> + #define FNM_CASEFOLD 0x08 /* Pattern is matched case-insensitive */
>> + #define FNM_LEADING_DIR 0x10 /* Ignore /<tail> after Imatch. */
>> + #endif
>> +
>
> Surely we must *not* be providing our own definitions of these symbols
> when using a system version of fnmatch.

That's the define that I reversed in the second patch I sent. It's
supposed to be ifndef.

> Also, judging from the comments in the autoconf manual, you'd better
> use AC_FUNC_FNMATCH not just test whether the function exists.

Ok, will look at switching to that.

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-20 21:00:25 Re: Autoconf, libpq and replacement function
Previous Message Tom Lane 2008-11-20 20:23:01 Re: Autoconf, libpq and replacement function