From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: Re: How do I determine the argument type... Date: Mon, 19 May 2003 10:47:43 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87addjwymo.fsf@zip.com.au> References: <3EBC71BF.B2264C7@veritas.com> <874r3t5o1f.fsf@zagadka.ping.de> <3EC6A6CA.94855664@veritas.com> <87of213tk0.fsf@zagadka.ping.de> <87ptmfx0i3.fsf@zip.com.au> <3EC82689.6A652B72@veritas.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053305265 32348 80.91.224.249 (19 May 2003 00:47:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 19 May 2003 00:47:45 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon May 19 02:47:44 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19HYoZ-0008Pc-00 for ; Mon, 19 May 2003 02:47:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HYpc-00020Y-06 for guile-devel@m.gmane.org; Sun, 18 May 2003 20:48:48 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19HYp4-00010e-00 for guile-devel@gnu.org; Sun, 18 May 2003 20:48:14 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19HYox-0000fC-00 for guile-devel@gnu.org; Sun, 18 May 2003 20:48:08 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HYow-0000GT-00 for guile-devel@gnu.org; Sun, 18 May 2003 20:48:06 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) h4J0lwxh022308 for ; Mon, 19 May 2003 10:47:58 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h4J0lvQg021352 for ; Mon, 19 May 2003 10:47:57 +1000 (EST) Original-Received: from localhost (ppp34.dyn228.pacific.net.au [203.143.228.34]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h4J0ltYZ006350 for ; Mon, 19 May 2003 10:47:55 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19HYoa-0000gP-00; Mon, 19 May 2003 10:47:44 +1000 Original-To: guile-devel@gnu.org In-Reply-To: <3EC82689.6A652B72@veritas.com> (Bruce Korb's message of "Sun, 18 May 2003 17:34:17 -0700") User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2407 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2407 Bruce Korb 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). _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel