diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/m_string.h | 4 | ||||
-rw-r--r-- | include/my_compiler.h | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/m_string.h b/include/m_string.h index 2ec4eb64c8e..bfe632e192d 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -76,7 +76,9 @@ extern "C" { extern void *(*my_str_malloc)(size_t); extern void (*my_str_free)(void *); -#if defined(HAVE_STPCPY) +#if MY_GNUC_PREREQ(3, 4) +#define strmov(dest, src) __builtin_stpcpy(dest, src) +#elif defined(HAVE_STPCPY) #define strmov(A,B) stpcpy((A),(B)) #ifndef stpcpy extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ diff --git a/include/my_compiler.h b/include/my_compiler.h index c7d334999d0..5f898621159 100644 --- a/include/my_compiler.h +++ b/include/my_compiler.h @@ -76,6 +76,11 @@ /** Generic (compiler-independent) features. */ + +#ifndef MY_GNUC_PREREQ +# define MY_GNUC_PREREQ(maj, min) (0) +#endif + #ifndef MY_ALIGNOF # ifdef __cplusplus template<typename type> struct my_alignof_helper { char m1; type m2; }; |