term% diff ../../../openldap-2.3.32/include/ac/time.h ../../include/ac
20c20
< #if defined(TIME_WITH_SYS_TIME)
---
> #if TIME_WITH_SYS_TIME
23c23
< #elif defined(HAVE_SYS_TIME_H)
---
> #elif HAVE_SYS_TIME_H
The < version is always valid; the > version is often valid.
After
#define A 1
#define B 0
#define C /* nothing! */
#undef D
These are like #if 1:
#if defined(A)
#if defined(B)
#if defined(C)
#if A
These are like #if 0:
#if defined(D)
#if B
#if D
and this is invalid:
#if C
(The rule for variables appearing in #if is that macros
expand and names that make it through macro expansion
turn into zeros, so `#if D' is like `#if 0' but `#if C' is like `#if',
which is missing an expression.)
So if the config.h for this program has done, say,
#define TIME_WITH_SYS_TIME 1
#define HAVE_SYS_TIME_H 1
then the two versions you have are equivalent, but
if it has done
#define TIME_WITH_SYS_TIME
#define HAVE_SYS_TIME_H
then only the #if defined(...) versions are valid C.
The convention in autoconf etc. is to either
#define X 1 or #undef X for each variable X.
Russ