Sorry, I neglected to cc the list on the subsequent discussions so here they are :)
- Luke -----Original Message----- From: Luke Hoffmann Sent: Tuesday, 11 June 2002 2:18 PM To: 'Dmitry' Subject: RE: [Mspgcc-users] compiler defines Thanks for the tip re [wakeup]. It works much better without the braces :) I guess the __MSP430__ define will work provided IAR do not define __MSP430__ as well. Thanks Luke -----Original Message----- From: Dmitry [mailto:[email protected]] Sent: Tuesday, 11 June 2002 2:07 PM To: Luke Hoffmann Subject: Re: [Mspgcc-users] compiler defines Luke, A.2 says: MSP430 - for every arch __MSP430__ - for every arch __MSP430_XXX__ - where XXX one from the list above (__MSP430_149__ for example) Another defenitions are (you do not really need them): __GNUC__=3 __GNUC_MINOR__=0 __GNUC_PATCHLEVEL__=0 __OPTIMIZE__ <-- if optimization enabled __STDC_HOSTED__=1 MSP430_NO_HW_MUL <-- for arches without hwmul MSP430_HAS_HW_MUL <-- with one __SIZE_TYPE__=unsigned int __PTRDIFF_TYPE__=int __INT_MAX__=32767 So, your code will be: #if defined(__MSP430__) interrupt(PORT2_VECTOR) wakeup port2Handler() { #elif defined(IAR_COMPILER) interrupt [PORT2_VECTOR] port2Handler() { wakeup(); #endif } Please note, that you do not have to put [] for wakeup, cause this is an attribute defenition ([a,b] stands for 'a' or 'b') cheers, ~d On Tue, 11 Jun 2002 14:02:35 +0800 Luke Hoffmann <[email protected]> wrote: > Hi, > > I had a look in docs ( msp430-libc/doc/ ) already. > > It has a section "A.2 Compiler defined Symbols" but does not mention any > compiler specific symbols just target symbols. > > I was looking for a symbol such as "__mspgcc" so I can write code like > > #if defined(__mspgcc) > interrupt (PORT2_VECTOR) [wakeup] port2Handler > { > #elif defined(IAR_COMPILER) > interrupt (PORT2_VECTOR) port2Handler > { > wakeup(); > #endif > } > > This brings me to my other Q about [wakeup]. > For some unknown reason the compiler is spits it when it encounters the first > '['. > Any ideas? > > Thanks > Luke > > > -----Original Message----- > From: Dmitry [mailto:[email protected]] > Sent: Tuesday, 11 June 2002 1:48 PM > To: Luke Hoffmann > Cc: [email protected] > Subject: Re: [Mspgcc-users] compiler defines > > > Hi Luke, > > Everything is in docs ( msp430-libc/doc/ ) > Almost all SFRs are defined in corresponding includes. > > > On Tue, 11 Jun 2002 12:39:06 +0800 > Luke Hoffmann <[email protected]> wrote: > > > Hi, > > > > I was wanting to conditionally compile code based on the current compiler. > > > > Does anyone know any symbols that the mspgcc compiler defines that I can > > use to do this. > > > > And if you do know please can you tell us :) > > > > Thanks > > Luke > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas - > > http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > > > _______________________________________________ > > Mspgcc-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > > /******************************************************************** > ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ > `6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys > (_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44 > _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia > (il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314 > ********************************************************************/ > /******************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys (_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44 _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314 ********************************************************************/
