Re: [AD] Darwin/MacOS X port

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2002-02-13, Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
[snip]
> 
> Both user's main() and our main() are replaced by _mangled_main() !
> 
> Do we hit a fondamental limitation of the C preprocessor, or is there a
> trick to work around the problem ?

GNU cpp:

	#define main(ARGS...) _mangled_main(ARGS)

	#define END_OF_MAIN() \
	int (main)(int argc, char *argv[]) {}


Without variadic macros all I can think of is:

	#define main(ARGC, ARGV) _mangled_main(ARGC, ARGV)

	#define END_OF_MAIN() \
	int (main)(int argc, char *argv[]) {}

Of course, that forces the user to have two argument main's.
At least they get a warning...



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/