Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Modify ctype.h headers to test for non-GNU inline semantics correctly
Browse files Browse the repository at this point in the history
GCC and Clang will not define __GNUC_STDC_INLINE__ when compiling C++, so this
macro currently implies regular C++ inline semantics in C++. This may cause
the compiler to emit an external definition of the function, which will cause
link errors when compiling with -fvisibility=hidden; see e.g. crbug.com/481902.

To fix this, also test the __cplusplus macro when deciding whether to assume
non-GNU inline semantics.

Change-Id: Icbd1f42279c2f65610e62f21d4a0a09d3b0e091c
  • Loading branch information
pcc committed May 14, 2015
1 parent 2d7242f commit c90758f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ndk/platforms/android-3/include/ctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern const short *_toupper_tab_;

/* extern __inline is a GNU C extension */
#ifdef __GNUC__
# if defined(__GNUC_STDC_INLINE__)
# if defined(__GNUC_STDC_INLINE__) || defined(__cplusplus) || defined(__cplusplus)
#define __CTYPE_INLINE extern __inline __attribute__((__gnu_inline__))
# else
#define __CTYPE_INLINE extern __inline
Expand Down

0 comments on commit c90758f

Please sign in to comment.