Re: Guile FFI: resizable vector problem

Andreas Rottmann <[email protected]> Fri, 20 Feb 2004 14:30:16 +0100
Newsgroups gmane.lisp.scheme.pika.devel
Message-ID <[email protected]>
Tom Lord <lord-1tv/[email protected]> writes:

>     > From: Andreas Rottmann <[email protected]>
>
>     > That also would solve the second feature macro I've in use so
>     > far: SCM_FEATURE_CHAR_UNICODE. If it isn't defined, the
>     > implementation is only guaranteed to support ASCII chars. I
>     > think the macros would come handy in the scm/tests, however,
>     > that way the test cases can be shared among all implementations.
>
> I'm not against the feature-macro idea.  It makes me a _little_
> nervous just because I don't like #ifdef'ed code -- but on the other
> hand, ASCII-only (or iso8859-*-only) optoins would be very winning
> things to provide.
>
In fact, there is no real need to #ifdef the code; something like the
following will work as well, since the API stays the same, it's just
that some usage of the API isn't supported:

#define SCM_FEATURE_CHAR_UNICODE 0 /* or 1, must be #defined always */

if (SCM_FEATURE_CHAR_UNICODE)
  do_unicode_tests ();

Regards, Andy
-- 
Andreas Rottmann         | [email protected]      | 118634484@ICQ | [email protected]
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!