Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!mhres!jv From: jv@mhres.mh.nl (Johan Vromans) Newsgroups: comp.lang.c Subject: Re: Does ANSI C have lengthof() ? Message-ID: <1295@mhres.mh.nl> Date: Wed, 9-Sep-87 04:08:44 EDT Article-I.D.: mhres.1295 Posted: Wed Sep 9 04:08:44 1987 Date-Received: Thu, 10-Sep-87 06:51:54 EDT References: <9154@brl-adm.ARPA> <1265@mhres.mh.nl> <5360@utcsri.UUCP> Organization: Multihouse N.V., The Netherlands Lines: 32 In article <5360@utcsri.UUCP> flaps@utcsri.UUCP (Alan J Rosenthal) writes: | |In article <1265@mhres.mh.nl> jv@mhres.mh.nl (Johan Vromans) writes: |>I think there is more need for these functions in the pre-processor: |> |> # if sizeof (char*) == sizeof (int) |> [...] |> # endif | |Besides Doug Gwyn's completely-correct comment that you should be |saying "typedef char *numptr", this facility currently exists anyway: | | #if sizeof(char *) == sizeof(int) | [...] | #endif | Has your C-preprocessor "sizeof" built-in? Quite exceptional. |And, of course, you could always use "#define numptr int" so that you |could later "#ifdef numptr". The point is that on 16/32 bit machines (like IBM-PC) I need to have a "long" hole to store a pointer (for whatever purpose), and on 16 bit machines I need an "int" hole. And I want the pre-processor and/or compiler to arrange this for me, so I have portable sources. -- Johan Vromans | jv@mh.nl via European backbone Multihouse N.V., Gouda, the Netherlands | uucp: ..{?????!}mcvax!mh.nl!jv "It is better to light a candle than to curse the darkness"