[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A macro to check for data type alignment
From: |
Russ Allbery |
Subject: |
Re: A macro to check for data type alignment |
Date: |
Mon, 11 Feb 2002 21:59:34 -0800 |
User-agent: |
Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Common Lisp, sparc-sun-solaris2.6) |
Peter Eisentraut <address@hidden> writes:
> Since you asked for contribution of specific macros, I have picked out a
> few macros from our project that could be of general applicability.
> I'll just show you the macro right now; if you want to have it I'll
> supply a real patch and documentation updates.
> Here is a macro that checks whether the gettimeofday() function takes only
> 1 argument (normal is 2, the second argument is the time zone). This is
> the case on some SVR4 systems. If this is found to be the case, the macro
> inserts of definition
> #define gettimeofday(a,b) gettimeofday(a)
> into config.h. Thus gettimezone can be used consistently throughout the
> code without changes. (The use of the second argument is obsolete on
> modern systems, so there are not real problems to be expected from
> ignoring it.)
These days, I'd recommend that people just drop the second argument from
all calls to gettimeofday, or if they can't do that just include the above
#define unconditionally. I don't know when you'd ever actually want to
check. Do you really use the second argument, and is it actually
accurate?
The two-argument form has been obsolete for quite a long time.
--
Russ Allbery (address@hidden) <http://www.eyrie.org/~eagle/>