Mail Archives: djgpp/1999/03/25/10:50:54
Wojciech Piechowski (voyt AT ds2 DOT pg DOT gda DOT pl) wrote:
: Hi
: I wonder why the following line does not compile and how to make it work:
: #if sizeof(long int)==sizeof(int)
: (Borland likes it)
As I recall, the ANSI/ISO standard for the C language specifies that
sizeof() is evaluated AFTER the conditional compilation directives, not
before. That being the case you cannot use this construct in any ANSI-
conforming program/compiler.
There is a standard include named limits.h which contains information
that can be used to write some somewhat different code that will in the
end do what you want, but you can't do it in this way. Check out limits.h
and look for INT_MAX and LONG_MAX.
Fred
--
---- Fred Smith -- fredex AT fcshome DOT stoneham DOT ma DOT us -----------------------------
I can do all things through Christ
who strengthens me.
------------------------------ Philippians 4:13 -------------------------------
- Raw text -