[cc65] preprocessor hazzle...

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2002-07-26 19:48:59


hyho...

i've been trying to port "small" (which is a quite nice embedded
scripting language very useful for creating games logic and simelar
stuff, funny enough its compiler is also originated from the small-c
compiler) to cc65, and encountered some problems ....

1)
shouldnt the compiler ignore #pragmas that it doesnt support? (instead
of issuing an error).... sorry if thats a dumb question, i've never
used pragmas myself in a portable program before, and didnt stumble
about any that would cause problems until now either ;=P

and, if the errors are correct, more #ifdef voodoo is the logical
conclusion? :=/ (infect i guess that all compilers ever used to
compile that code support the "pack" pragma in question so they
probably didnt care about possible hazzle with it ;/)

2)
i remember that theres some problem with the preprocessor, but i am
unsure if this here is related to those or if its just an unrelated
bug :o)
that code uses an expression like

#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L

to figure out if certain C99 types are available.... cc65 gives me an
error on the second part of the expression.... i tried to work around
this by doing sth like

#if !defined __STDC_VERSION__
# define bingo
#endif
#if defined __STDC_VERSION__
# if __STDC_VERSION__ < 199901L
#  define bingo
# endif
#endif
#ifdef bingo

but strange enough, although __STDC_VERSION__ is not defined, cc65
gives me an error on the "# if __STDC_VERSION__ < 199901L" line ?!
(shouldnt it really completely ignore everything until next #endif here ?!)

this kind of beats me ;=P please gimme a hint on how to work around this
without having to add a tons of additional #ifdef voodoo to the
original source :)

tjam.... would be great to get help with this asap, since i am really
curious to see if "small" might actually be useful on a c64 (or any
other cc65 target for that matter) :o)

-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net

btw as a sidenote.... i noticed the cc65.org frontpage doesnt mention
"cygwin" in the list of working hosts.... so you can add that it works
like a charm in win9x-hosted (prolly nt/2000/xp aswell then) cygwin,
with really minor changes in the gcc-makefiles (some pathes if i
remember right, eg to let it find perl). compiles without a single
warning (-O2 -Wall) btw, good job :O)


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-07-26 19:54:28 CEST