How The Runtime-Support Library Uses The _Inline Preprocessor Symbol - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

Example 2−1. How the Run-Time-Support Library Uses the _INLINE Preprocessor
Symbol
(a) string.h
/****************************************************************************/
/* STRING.H HEADER FILE
/****************************************************************************/
typdef unsigned size_t
#if _INLINE
#define __INLINE static inline
#else
#define __INLINE
#endif
__INLINE
void *memcpy (void *_s1, const void *_s2, size_t _n);
#if _INLINE
static inline void *memcpy (void *to, const void *from, size_t n)
{
register char *rto
register char *rfrom = (char *) from;
register size_t rn;
for (rn = 0; rn < n; rn++) *rto++ =rfrom++;
return (to);
}
#endif
/* _INLINE
#undef __INLINE
(b) strlen.c
/****************************************************************************/
/* MEMCPY.C
(rts2xx.lib)
/****************************************************************************/
#undef _INLINE
#include <string.h>
void *memcpy (void *to, const void *from, size_t n)
{
register char *rto
register char *rfrom = (char *) from;
register size_t rn;
for (rn = 0; rn < n; rn++) *rto++ =rfrom++;
return (to);
}
/* Declaration when inlining
/*No declaration when not inlining
/* Declare the inlined function
= (char *) to;
*/
/* Turn off so code will be generated
= (char *) to;
Using Inline Function Expansion
*/
*/
*/
C Compiler Description
*/
*/
*/
2-33

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents