summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/my_pthread.h12
-rw-r--r--include/my_sys.h7
2 files changed, 14 insertions, 5 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 038030540e8..a822d2db484 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -522,11 +522,13 @@ typedef struct _my_rw_lock_t {
#define rw_unlock(A) my_rw_unlock((A))
#define rwlock_destroy(A) my_rwlock_destroy((A))
-extern int my_rwlock_init( my_rw_lock_t *, void * );
-extern int my_rwlock_destroy( my_rw_lock_t * );
-extern int my_rw_rdlock( my_rw_lock_t * );
-extern int my_rw_wrlock( my_rw_lock_t * );
-extern int my_rw_unlock( my_rw_lock_t * );
+extern int my_rwlock_init(my_rw_lock_t *, void *);
+extern int my_rwlock_destroy(my_rw_lock_t *);
+extern int my_rw_rdlock(my_rw_lock_t *);
+extern int my_rw_wrlock(my_rw_lock_t *);
+extern int my_rw_unlock(my_rw_lock_t *);
+extern int my_rw_tryrdlock(my_rw_lock_t *);
+extern int my_rw_trywrlock(my_rw_lock_t *);
#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */
#define GETHOSTBYADDR_BUFF_SIZE 2048
diff --git a/include/my_sys.h b/include/my_sys.h
index 0b191c17173..664131e8187 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -159,6 +159,13 @@ extern my_string my_strdup(const char *from,myf MyFlags);
#define ORIG_CALLER_INFO /* nothing */
#endif
#ifdef HAVE_ALLOCA
+#ifdef __GNUC__
+/* Remove any previous definitions. */
+#undef alloca
+#define alloca(size) __builtin_alloca (size)
+#else /* xlc */
+ #pragma alloca
+#endif /* GCC. */
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) {}
#else