Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!ucsd!ucsdhub!esosun!seismo!uunet!ateng!chip From: chip@ateng.uucp (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: Absolute size of 'short' Message-ID: <1988Sep6.121051.21516@ateng.uucp> Date: 6 Sep 88 16:10:50 GMT References: <214@ISIDAPS5.UUCP> <9641@dartvax.Dartmouth.EDU> <62505@sun.uucp> <625@proxftl.UUCP> <1382@ficc.uu.net> <678@proxftl.UUCP> <6938@haddock.ima.isc.com> Reply-To: chip@ateng.UUCP (Chip Salzenberg) Organization: A T Engineering, Tampa, FL Lines: 22 According to karl@haddock.ima.isc.com (Karl Heuer): > typedef short int_9, int_10, /*...*/, int_16; > typedef long int_17, /*...*/, int_32; [etc.] >(One admitted flaw: the bitwidth must be specified directly in this scheme; >you can't compute it at compile-time.) Perhaps you can: #define xintbits(n) int_ ## n #define intbits(n) xintbits(n) /* The nested macro expands the argument before concatenating tokens. */ #define COLORBITS 9 typedef intbits(COLORBITS) color_t; -- Chip Salzenberg or A T Engineering My employer may or may not agree with me. The urgent leaves no time for the important.