Intrinsics are pseudo-function that are expanded into code within the compiler; there are no macros that provide them. Check for features like this by comparing the mspgcc release version with when the feature was added:
#if 20110809 <= __MSPGCC__ /* __delaycycles up to 2^32-1 supported */ #elif 20110716 <= __MSPGCC__ /* __delaycycles up to about 198000 supported */ #else /* __delaycycles not supported */ #endif Peter On Thu, Mar 8, 2012 at 11:24 AM, Don Bindner <don.bind...@gmail.com> wrote: > I do coding on both the 4.4.5 compiler, which does not have the > __delay_cycles() intrinsic function, and on the 4.5.3 compiler which does. > I'd sometimes like code that compiles on either, and the actual delay > amounts aren't necessarily critical (they just have to occur). > > I'd like to do something like the following: > > #ifndef __delay_cycles > /* A crude delay function. */ > inline void __delay_cycles( unsigned long int delay ) { > volatile unsigned int i = delay/3; > while( i-- ) ; > } > #endif > > But even when the intrinsic function is available, the #ifndef triggers. > Is there some reliable way to test for the intrinsic? > > Don > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users