Viitor_cc65/usr/share/doc/cc65/webdoc/cc65-6.html
kueller 223cc6685e Neue Version V963
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_cc65@5933 504e572c-2e33-0410-9681-be2bf7408885
2011-01-03 10:48:06 +00:00

95 lines
4.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
<TITLE>cc65 Users Guide: Predefined macros</TITLE>
<LINK HREF="cc65-7.html" REL=next>
<LINK HREF="cc65-5.html" REL=previous>
<LINK HREF="cc65.html#toc6" REL=contents>
</HEAD>
<BODY>
<A HREF="cc65-7.html">Next</A>
<A HREF="cc65-5.html">Previous</A>
<A HREF="cc65.html#toc6">Contents</A>
<HR>
<H2><A NAME="s6">6.</A> <A HREF="cc65.html#toc6">Predefined macros</A></H2>
<P>The compiler defines several macros at startup:</P>
<P>
<DL>
<DT><B><CODE>__CC65__</CODE></B><DD><P>This macro is always defined. Its value is the version number of the
compiler in hex. For example, version 2.10.1 of the compiler has this macro
defined as <CODE>0x02A1</CODE>.</P>
<DT><B><CODE>__APPLE2__</CODE></B><DD><P>This macro is defined if the target is the Apple ][ (-t apple2).</P>
<DT><B><CODE>__APPLE2ENH__</CODE></B><DD><P>This macro is defined if the target is the enhanced Apple // (-t apple2enh).</P>
<DT><B><CODE>__ATARI__</CODE></B><DD><P>This macro is defined if the target is one of the Atari computers
(400/800/130XL/800XL).</P>
<DT><B><CODE>__ATMOS__</CODE></B><DD><P>This macro is defined if the target is the Oric Atmos (-t atmos).</P>
<DT><B><CODE>__CBM__</CODE></B><DD><P>This macro is defined if the target system is one of the CBM targets.</P>
<DT><B><CODE>__C16__</CODE></B><DD><P>This macro is defined if the target is the c16 (-t c16).</P>
<DT><B><CODE>__C64__</CODE></B><DD><P>This macro is defined if the target is the c64 (-t c64).</P>
<DT><B><CODE>__C128__</CODE></B><DD><P>This macro is defined if the target is the c128 (-t c128).</P>
<DT><B><CODE>__CBM510__</CODE></B><DD><P>This macro is defined if the target is the CBM 500 series of computers.</P>
<DT><B><CODE>__CBM610__</CODE></B><DD><P>This macro is defined if the target is one of the CBM 600/700 family of
computers (called B series in the US).</P>
<DT><B><CODE>__GEOS__</CODE></B><DD><P>This macro is defined if you are compiling for the GEOS system (-t geos).</P>
<DT><B><CODE>__LUNIX__</CODE></B><DD><P>This macro is defined if you are compiling for the LUnix system (-t lunix).</P>
<DT><B><CODE>__LYNX__</CODE></B><DD><P>This macro is defined if the target is the Atari Lynx (-t lynx).</P>
<DT><B><CODE>__NES__</CODE></B><DD><P>This macro is defined if the target is the NES (-t nes).</P>
<DT><B><CODE>__PET__</CODE></B><DD><P>This macro is defined if the target is the PET family of computers (-t pet).</P>
<DT><B><CODE>__PLUS4__</CODE></B><DD><P>This macro is defined if the target is the plus/4 (-t plus4).</P>
<DT><B><CODE>__SUPERVISION__</CODE></B><DD><P>This macro is defined if the target is the supervision (-t supervision).</P>
<DT><B><CODE>__VIC20__</CODE></B><DD><P>This macro is defined if the target is the vic20 (-t vic20).</P>
<DT><B><CODE>__FILE__</CODE></B><DD><P>This macro expands to a string containing the name of the C source file.</P>
<DT><B><CODE>__LINE__</CODE></B><DD><P>This macro expands to the current line number.</P>
<DT><B><CODE>__CC65_STD__</CODE></B><DD><P>This macro is defined to one of the following depending on the <CODE>
<A HREF="cc65-2.html#option--standard">--standard</A></CODE> command line option:
<UL>
<LI><CODE>__CC65_STD_C89__</CODE></LI>
<LI><CODE>__CC65_STD_C99__</CODE></LI>
<LI><CODE>__CC65_STD_CC65__</CODE></LI>
</UL>
</P>
<DT><B><CODE>__OPT__</CODE></B><DD><P>Is defined if the compiler was called with the <CODE>-O</CODE> command line option.</P>
<DT><B><CODE>__OPT_i__</CODE></B><DD><P>Is defined if the compiler was called with the <CODE>-Oi</CODE> command line option.</P>
<DT><B><CODE>__OPT_r__</CODE></B><DD><P>Is defined if the compiler was called with the <CODE>-Or</CODE> command line option.</P>
<DT><B><CODE>__OPT_s__</CODE></B><DD><P>Is defined if the compiler was called with the <CODE>-Os</CODE> command line option.</P>
</DL>
</P>
<HR>
<A HREF="cc65-7.html">Next</A>
<A HREF="cc65-5.html">Previous</A>
<A HREF="cc65.html#toc6">Contents</A>
</BODY>
</HTML>