Motorola MPC5200 Manuel D’Utilisation

Page de 28
KwikNet MPC5200 FEC Device Driver
KADAK
9
6.2  BestComm Source Code Modifications
KADAK has successfully used the BestComm API and firmware source code without
modification using the Metrowerks software development tools.  All modules have been
successfully compiled without warnings or errors.
However, when the BestComm source code is compiled using the Diab (Wind River) or
MetaWare tools, numerous warnings and some errors are encountered.  KADAK has
made no attempt to review or repair the source code which generated warnings.
However, many years of experience with these tools have proven that it is not wise to
ignore the warnings and Freescale should be encouraged to review the source code.
The errors occur because of the use of the non-ANSI C keyword 
inline
 in header file
BESTCOMM_API.H
.  This keyword is not supported by either Diab or MetaWare compilers.
To avoid the errors when using these tools, KADAK has inserted the following code
fragment near the beginning of header file 
BESTCOMM_API.H
:
/* KADAK Products Ltd.
*/
/* Patch to avoid compiler errors.
*/
#ifdef CC_INLINE
/* Define alternate keyword for inline function declaration.
*/
#define inline CC_INLINE
#endif
Symbol 
CC_INLINE
, if required, is defined on the command line used to invoke the
compiler in tailoring file 
KN5200E.INC
.
If the compiler supports an alternate keyword for an in-line function, symbol 
CC_INLINE
is defined to be that keyword.  For example, the tailoring file for MetaWare tools defines
CC_INLINE
 to be 
_Inline
, the equivalent MetaWare keyword.
If the compiler does not support in-line functions, symbol 
CC_INLINE
 must be defined to
be an empty string.  For example, the tailoring file for Diab tools defines 
CC_INLINE
 but
does not specify a value for the symbol, since it does not support the feature.
If the compiler supports the 
inline
 keyword, symbol 
CC_INLINE
 must not be defined.
Note
No improper operation of the BestComm API and
microcode has been observed as a consequence of this code
patch.  Note that the BestComm software compiled in this
fashion has been exercised using the FEC subsystem only.