[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I determine the argument type...
From: |
Kevin Ryde |
Subject: |
Re: How do I determine the argument type... |
Date: |
Mon, 19 May 2003 10:47:43 +1000 |
User-agent: |
Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) |
Bruce Korb <address@hidden> writes:
>
> A macro cannot hide the problem. You cannot set it back to int without
> breaking everyone who adapted to size_t.
I was thinking of something like,
#define gh_scm2newstr(str,lenp) \
gh_scm2newstr_helper (str, lenp, sizeof (*lenp))
Not sure if all compilers will enjoy "sizeof(*NULL)" though.
Another way would be the following, though it unfortunately evaluates
the parameters more than once. In gcc that could be avoided,
probably.
#define gh_scm2newstr(str,lenp) \
((lenp) ? *(lenp) = gh_scmstrlen (str) : 0, \
gh_scm2newstr_helper (str))
> "Oops.
I guess insofar as it's contrary to the docs it's an oops.
> use this configury macro to specify the type passed to
> gh_scm2newstr()."
Probably as simple as an AC_TRY_COMPILE (or AC_COMPILE_IFELSE, or
whatever it's called these days).