mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
libc: Unify the selection of inline or macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I44a26550ff856af07d2d96a6f0a6066f988d6da3
This commit is contained in:
+12
-8
@@ -48,11 +48,13 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_HAVE_INLINE) && !defined(__cplusplus)
|
||||
#ifndef CONFIG_HAVE_INLINE
|
||||
/* Compatibility definitions
|
||||
*
|
||||
* Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
|
||||
* Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
|
||||
* Marked LEGACY in Open Group Base Specifications Issue 6/
|
||||
* IEEE Std 1003.1-2004
|
||||
* Removed from Open Group Base Specifications Issue 7/
|
||||
* IEEE Std 1003.1-2008
|
||||
*/
|
||||
|
||||
# define bcmp(b1,b2,len) memcmp(b1,b2,(size_t)len)
|
||||
@@ -61,7 +63,7 @@
|
||||
# define index(s,c) strchr(s,c)
|
||||
# define rindex(s,c) strrchr(s,c)
|
||||
|
||||
#endif /* !CONFIG_HAVE_INLINE && !__cplusplus */
|
||||
#endif /* !CONFIG_HAVE_INLINE */
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
@@ -76,11 +78,13 @@ extern "C"
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HAVE_INLINE) || defined(__cplusplus)
|
||||
#ifdef CONFIG_HAVE_INLINE
|
||||
/* Compatibility inline functions.
|
||||
*
|
||||
* Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
|
||||
* Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
|
||||
* Marked LEGACY in Open Group Base Specifications Issue 6/
|
||||
* IEEE Std 1003.1-2004
|
||||
* Removed from Open Group Base Specifications Issue 7/
|
||||
* IEEE Std 1003.1-2008
|
||||
*/
|
||||
|
||||
static inline int bcmp(FAR const void *b1, FAR const void *b2, size_t len)
|
||||
@@ -107,7 +111,7 @@ static inline FAR char *rindex(FAR const char *s, int c)
|
||||
{
|
||||
return strrchr(s, c);
|
||||
}
|
||||
#endif /* CONFIG_HAVE_INLINE || __cplusplus */
|
||||
#endif /* CONFIG_HAVE_INLINE */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
|
||||
Reference in New Issue
Block a user