Re: [pcre-dev] A problem with config.h.generic

Top Page
Delete this message
Author: Ralf Junker
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] A problem with config.h.generic
On 08.12.2012 13:23, Philip Hazel wrote:

> There seems to be general support for (b) so far, so I will proceed with
> arranging for suitable comments to end up in the code. What do people
> think about the added lines such as these:
>
> /* Define to 1 if you have the <stdint.h> header file. */
> #ifndef HAVE_STDINT_H         <============ Added line =============
> #define HAVE_STDINT_H 1
> #endif                        <============ Added line =============


I very much like to keep this version because it allows to override
config.h on the command line via the -D switch:

-DHAVE_STDINT_H=0

Some users might find command line options easier and more flexible than
modifying config.h[.generic].

With #undef, this is not easily possible AFAIK.

I would change the comment to point out what the default setting does
and list other options and explain what they do:

/*
** Assume that the system has the <stdint.h> header file.
** Define to 0 if it does not.
*/
#ifndef HAVE_STDINT_H         <============ Added line =============
#define HAVE_STDINT_H 1
#endif                        <============ Added line =============


> Should that end up as (a):
>
> /* Define to any value if you have the <stdint.h> header file. */
> /* Use #undef to undefine if you do not. */
> #ifndef HAVE_STDINT_H         <============ Added line =============
> #define HAVE_STDINT_H 1
> #endif                        <============ Added line =============


I don't like #undef because when #defined in code, a value can not be
undefined via the command line. I know that C++ Builder does not have
this option and there might be others as indicated here:

http://stackoverflow.com/questions/1978155/how-to-undefine-a-define-at-commandline-using-gcc

Ralf