[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Handling __STDC__ on Windows
From: |
Paul Eggert |
Subject: |
Re: Handling __STDC__ on Windows |
Date: |
Wed, 13 Jul 2005 13:20:49 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
"Paul D. Smith" <address@hidden> writes:
> I have a bunch of macros in GNU make that try to determine whether the
> compiler groks ANSI C, like this:
>
> #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
>
> But, that doesn't work on Windows because the Windows compilers do this:
>
> #define __STDC__ 0
Solaris C compilers do something similar.
> What is the autoconf-recommended, portable way to handle this?
Two possibilities. First:
#ifdef __STDC__
This worked well for me back when I was worried about this issue.
Second, and the solution I recommend these days, is to simply assume
C89 or better. Nobody uses pre-C89 compilers any more, except for
computer museums (which are not a serious platform for the GNU
project), so there's no point to have you worrying about pre-C89
compilers any more. GDB, GCC, coreutils, tar, etc., etc., all assume
C89 or better now, so you'd be in good company.