| delorie.com/archives/browse.cgi | search |
| Message-ID: | <373B5C01.9E56DE9C@unb.ca> |
| Date: | Thu, 13 May 1999 19:10:57 -0400 |
| From: | Endlisnis <s257m AT unb DOT ca> |
| X-Mailer: | Mozilla 4.51 [en] (Win95; U) |
| X-Accept-Language: | en |
| MIME-Version: | 1.0 |
| Newsgroups: | comp.os.msdos.djgpp |
| To: | djgpp AT delorie DOT com |
| Subject: | Re: Portability and size_t type related question |
| References: | <Pine DOT SOL DOT 4 DOT 10 DOT 9905131626430 DOT 17043-100000 AT cs DOT joensuu DOT fi> |
| X-Info: | BrunNet, Inc. 888-278-6638 |
| Reply-To: | djgpp AT delorie DOT com |
> Another solution for making system-independent definition
> for U32, for example, would be:
>
> #include <limits.h>
> #if (INT_MAX == 2147483647)
> typedef int int32;
> #elif (LONG_MAX == 2147483647)
> typedef long int32;
> #elif (SHRT_MAX == 2147483647)
> typedef short int32;
> #else
> #error "No 32-bit type!"
> #endif
>
> Not very nice but should work in most cases.
That will not work on systems with a byte size other than 8.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT HotMail DOT com
ICQ: 32959047
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |