How to force cpp to abort?
Michael P. Gerlek
mikeg at c3.c3.lanl.gov
Sun Aug 12 10:00:36 AEST 1990
I'm writing some machine dependent code...
#if defined(__convex__)
(do Convex stuff)
#else
#if defined(cray)
(do Cray stuff)
#else
#if defined(sun)
(do Sun stuff)
#else
(oops) /* force abort */
#endif
#endif
#endif
Question: if the code is compiled on, say, a Vax, how do I force the
compiler (or perhaps cpp) to abort in the "oops" block above? Sure, I
could throw in some syntactically bad code and force a syntax error,
but that's not really very clean. Sure, too, I could conditonally
compile in an fprintf(stderr,"Machine not supported"), but the code
would have to be run - I want to cleanly abort at compile-time.
Suggestions?
[ M.P.Gerlek (mikeg at lanl.gov) -
[ Los Alamos Nat'l Lab / Merrimack College -
[ Disclaimer: Yes, Mom, I'll play nice. -
[ "My other machine's a multi-threaded YMP." -
More information about the Comp.lang.c
mailing list