summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-07-31 19:29:07 +0200
committerSergei Golubchik <sergii@pisem.net>2012-07-31 19:29:07 +0200
commit0117a92fedc2e5294682127d54034af5b3f96c8e (patch)
tree0c075a3fa43f64a3895acc704bacf69a96afda14
parent42ea25d4c51b5466b4b03a29abe480e763732cf2 (diff)
downloadmariadb-git-0117a92fedc2e5294682127d54034af5b3f96c8e.tar.gz
MDEV-419 ensure that all HAVE_XXX constants can be set by cmake
add missing checks to configure.cmake remove dead code and unused HAVE_xxx constants from the sources
-rw-r--r--client/get_password.c4
-rw-r--r--cmake/readline.cmake2
-rw-r--r--config.h.cmake7
-rw-r--r--configure.cmake6
-rw-r--r--extra/resolveip.c4
-rw-r--r--include/m_string.h6
-rw-r--r--include/my_global.h28
-rw-r--r--include/my_net.h2
-rw-r--r--include/my_pthread.h68
-rw-r--r--libmysql/get_password.c4
-rw-r--r--mysys/charset-def.c2
-rw-r--r--mysys/my_chsize.c7
-rw-r--r--mysys/my_lock.c2
-rw-r--r--mysys/my_pthread.c69
-rw-r--r--mysys/my_rename.c16
-rw-r--r--mysys/thr_mutex.c3
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/signal_handler.cc17
-rw-r--r--sql/spatial.h2
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_profile.h2
-rw-r--r--storage/maria/maria_chk.c3
-rw-r--r--storage/myisam/mi_extra.c2
-rw-r--r--storage/myisam/myisamchk.c3
-rw-r--r--unittest/mysys/ma_dyncol-t.c2
-rw-r--r--unittest/strings/strings-t.c2
26 files changed, 31 insertions, 240 deletions
diff --git a/client/get_password.c b/client/get_password.c
index c6653183f48..09d307b5553 100644
--- a/client/get_password.c
+++ b/client/get_password.c
@@ -23,10 +23,6 @@
#include <m_string.h>
#include <m_ctype.h>
-#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE)
-#undef HAVE_GETPASS
-#endif
-
#ifdef HAVE_GETPASS
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/cmake/readline.cmake b/cmake/readline.cmake
index fd2e690fab9..285b436921e 100644
--- a/cmake/readline.cmake
+++ b/cmake/readline.cmake
@@ -109,6 +109,8 @@ MACRO (FIND_CURSES)
ENDIF()
ENDIF()
ENDIF()
+ CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} setupterm "" HAVE_SETUPTERM)
+ CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} vidattr "" HAVE_VIDATTR)
ENDMACRO()
MACRO (MYSQL_USE_BUNDLED_READLINE)
diff --git a/config.h.cmake b/config.h.cmake
index 65c90ad3fbe..e6ec8b23b58 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -46,6 +46,7 @@
#cmakedefine HAVE_IEEEFP_H 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_LIMITS_H 1
+#cmakedefine HAVE_LINUX_UNISTD_H 1
#cmakedefine HAVE_LOCALE_H 1
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_MEMORY_H 1
@@ -131,6 +132,7 @@
#cmakedefine FIONREAD_IN_SYS_FILIO 1
/* Functions we may want to use. */
+#cmakedefine HAVE_ACCESS 1
#cmakedefine HAVE_AIOWAIT 1
#cmakedefine HAVE_ALARM 1
#cmakedefine HAVE_ALLOCA 1
@@ -152,6 +154,7 @@
#cmakedefine HAVE_FCONVERT 1
#cmakedefine HAVE_FDATASYNC 1
#cmakedefine HAVE_DECL_FDATASYNC 1
+#cmakedefine HAVE_FEDISABLEEXCEPT 1
#cmakedefine HAVE_FESETROUND 1
#cmakedefine HAVE_FINITE 1
#cmakedefine HAVE_FP_EXCEPT 1
@@ -176,6 +179,7 @@
#cmakedefine HAVE_GETWD 1
#cmakedefine HAVE_GMTIME_R 1
#cmakedefine gmtime_r @gmtime_r@
+#cmakedefine HAVE_IN_ADDR_T 1
#cmakedefine HAVE_INITGROUPS 1
#cmakedefine HAVE_ISSETUGID 1
#cmakedefine HAVE_GETUID 1
@@ -216,6 +220,7 @@
#cmakedefine HAVE_RDTSCLL 1
#cmakedefine HAVE_READ_REAL_TIME 1
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
+#cmakedefine HAVE_PTHREAD_ATTR_GETGUARDSIZE 1
#cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1
#cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
@@ -248,6 +253,7 @@
#cmakedefine HAVE_SETFD 1
#cmakedefine HAVE_SETENV 1
#cmakedefine HAVE_SETLOCALE 1
+#cmakedefine HAVE_SETUPTERM 1
#cmakedefine HAVE_SIGADDSET 1
#cmakedefine HAVE_SIGEMPTYSET 1
#cmakedefine HAVE_SIGHOLD 1
@@ -285,6 +291,7 @@
#cmakedefine HAVE_TIME 1
#cmakedefine HAVE_TIMES 1
#cmakedefine HAVE_VALLOC 1
+#cmakedefine HAVE_VIDATTR 1
#define HAVE_VIO_READ_BUFF 1
#cmakedefine HAVE_VASPRINTF 1
#cmakedefine HAVE_VPRINTF 1
diff --git a/configure.cmake b/configure.cmake
index 3d1e2f25f65..1fb5fc920f6 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -202,6 +202,7 @@ CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H)
CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H)
CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H)
+CHECK_INCLUDE_FILES (linux/unistd.h HAVE_LINUX_UNISTD_H)
CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILES (locale.h HAVE_LOCALE_H)
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
@@ -327,6 +328,7 @@ ENDIF()
#
# Tests for functions
#
+CHECK_FUNCTION_EXISTS (access HAVE_ACCESS)
#CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT)
CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ)
CHECK_FUNCTION_EXISTS (alarm HAVE_ALARM)
@@ -555,6 +557,10 @@ IF(NOT SIZEOF_MODE_T)
SET(mode_t int)
ENDIF()
+IF(HAVE_NETINET_IN_H)
+ SET(CMAKE_EXTRA_INCLUDE_FILES netinet/in.h)
+ MY_CHECK_TYPE_SIZE(in_addr_t IN_ADDR_T)
+ENDIF(HAVE_NETINET_IN_H)
IF(HAVE_STDINT_H)
SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h)
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 871fd31482e..b6840d9d463 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -25,9 +25,7 @@
#ifndef WIN32
# include <sys/types.h>
# include <sys/socket.h>
-# ifndef HAVE_BROKEN_NETINET_INCLUDES
-# include <netinet/in.h>
-# endif
+# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
#endif
diff --git a/include/m_string.h b/include/m_string.h
index 9fc6cda4764..9efa0376942 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -62,13 +62,9 @@
# define bmove_align(A,B,C) memcpy((A),(B),(C))
-#if !defined(HAVE_BCMP)
# define bcmp(A,B,C) memcmp((A),(B),(C))
-#endif
-#if !defined(bzero) && (!defined(HAVE_BZERO) || !HAVE_DECL_BZERO || defined(_AIX))
-/* See autoconf doku: "HAVE_DECL_symbol" will be defined after configure, to 0 or 1 */
-/* AIX has bzero() as a function, but the declaration prototype is strangely hidden */
+#if !defined(bzero)
# define bzero(A,B) memset((A),0,(B))
#endif
diff --git a/include/my_global.h b/include/my_global.h
index a5fa57dbfe3..09a3a0a6efd 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -229,11 +229,6 @@
#include <sys/types.h>
#endif
-#ifdef HAVE_THREADS_WITHOUT_SOCKETS
-/* MIT pthreads does not work with unix sockets */
-#undef HAVE_SYS_UN_H
-#endif
-
#define __EXTENSIONS__ 1 /* We want some extension */
#ifndef __STDC_EXT__
#define __STDC_EXT__ 1 /* To get large file support on hpux */
@@ -306,18 +301,6 @@ inline double my_ulonglong2double(unsigned long long A) { return (double A); }
C_MODE_END
#endif /* _AIX */
-#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
-#undef HAVE_SNPRINTF
-#endif
-#ifdef HAVE_BROKEN_PREAD
-/*
- pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without
- installing the kernel patch PHKL_20349 or greater
-*/
-#undef HAVE_PREAD
-#undef HAVE_PWRITE
-#endif
-
#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */
#undef HAVE_INITGROUPS
#endif
@@ -823,18 +806,7 @@ inline unsigned long long my_double2ulonglong(double d)
#endif
#ifdef HAVE_ISINF
-/* Check if C compiler is affected by GCC bug #39228 */
-#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF)
-/* Force store/reload of the argument to/from a 64-bit double */
-static inline double my_isinf(double x)
-{
- volatile double t= x;
- return isinf(t);
-}
-#else
-/* System-provided isinf() is available and safe to use */
#define my_isinf(X) isinf(X)
-#endif
#else /* !HAVE_ISINF */
#define my_isinf(X) (!finite(X) && !isnan(X))
#endif
diff --git a/include/my_net.h b/include/my_net.h
index ce2ee6ce8ca..0ad3ebf0f30 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -43,7 +43,7 @@ C_MODE_START
#include <sys/ioctl.h>
#endif
-#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES)
+#if !defined(__WIN__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 21c85c633d6..404d5fb5258 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -200,28 +200,13 @@ extern int my_pthread_create_detached;
int sigwait(sigset_t *set, int *sig);
#endif
-#ifndef HAVE_NONPOSIX_SIGWAIT
#define my_sigwait(A,B) sigwait((A),(B))
-#else
-int my_sigwait(const sigset_t *set,int *sig);
-#endif
-
-#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
-#ifndef SAFE_MUTEX
-#define pthread_mutex_init(a,b) my_pthread_mutex_noposix_init((a),(b))
-extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp,
- const pthread_mutexattr_t *attr);
-#endif /* SAFE_MUTEX */
-#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b))
-extern int my_pthread_cond_noposix_init(pthread_cond_t *mp,
- const pthread_condattr_t *attr);
-#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK)
#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C))
#endif
-#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
+#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
@@ -247,24 +232,12 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#define my_sigset(A,B) signal((A),(B))
#endif
-#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
+#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE)
#define pthread_attr_setscope(A,B)
#undef HAVE_GETHOSTBYADDR_R /* No definition */
#endif
-#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX)
-extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
- pthread_mutex_t *mutex,
- struct timespec *abstime);
-#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
-#endif
-
-#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
-#else
-#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
-void *my_pthread_getspecific_imp(pthread_key_t key);
-#endif
#ifndef HAVE_LOCALTIME_R
struct tm *localtime_r(const time_t *clock, struct tm *res);
@@ -285,34 +258,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_key_delete(A) pthread_dummy(0)
#endif
-#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
-#define pthread_cond_destroy(A) pthread_dummy(0)
-#define pthread_mutex_destroy(A) pthread_dummy(0)
-#define pthread_attr_delete(A) pthread_dummy(0)
-#define pthread_condattr_delete(A) pthread_dummy(0)
-#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
-#define pthread_equal(A,B) ((A) == (B))
-#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b))
-#define pthread_attr_init(A) pthread_attr_create(A)
-#define pthread_attr_destroy(A) pthread_attr_delete(A)
-#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
-#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
-#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
-#undef pthread_detach_this_thread
-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
-#endif
-
-#ifdef HAVE_DARWIN5_THREADS
-#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
-#define pthread_condattr_init(A) pthread_dummy(0)
-#define pthread_condattr_destroy(A) pthread_dummy(0)
-#undef pthread_detach_this_thread
-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
-#endif
-
-#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
+#if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)
/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
#define pthread_key_create(A,B) \
pthread_keycreate(A,(B) ?\
@@ -352,7 +298,7 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
-#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
+#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
/* no pthread_yield() available */
#ifdef HAVE_SCHED_YIELD
#define pthread_yield() sched_yield()
@@ -541,12 +487,6 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp);
/* READ-WRITE thread locking */
-#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */
-#undef HAVE_PTHREAD_RWLOCK_RDLOCK
-#undef HAVE_RWLOCK_INIT
-#undef HAVE_RWLOCK_T
-#endif
-
#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
/* use these defs for simple mutex locking */
#define rw_lock_t pthread_mutex_t
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index a10d112ccd0..16f6b25822d 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -26,10 +26,6 @@
#include <m_string.h>
#include <m_ctype.h>
-#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE)
-#undef HAVE_GETPASS
-#endif
-
#ifdef HAVE_GETPASS
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 4183b1fcd99..e9f2ecdea49 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -326,7 +326,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
add_compiled_collation(&my_charset_utf16_hungarian_uca_ci);
add_compiled_collation(&my_charset_utf16_sinhala_uca_ci);
add_compiled_collation(&my_charset_utf16_croatian_uca_ci);
-#endif /* HAVE_UCA_COLLATIOINS */
+#endif /* HAVE_UCA_COLLATIONS */
#endif /* HAVE_CHARSET_utf16 */
diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c
index 97ecd881af1..63964916d6f 100644
--- a/mysys/my_chsize.c
+++ b/mysys/my_chsize.c
@@ -67,13 +67,6 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
goto err;
}
DBUG_RETURN(0);
-#elif defined(HAVE_CHSIZE)
- if (chsize(fd, (off_t) newlength))
- {
- my_errno=errno;
- goto err;
- }
- DBUG_RETURN(0);
#else
/*
Fill space between requested length and true length with 'filler'
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index c9e599904fa..54ec3838b58 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -212,7 +212,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
if (lockf(fd,locktype,length) != -1)
DBUG_RETURN(0);
#endif /* HAVE_FCNTL */
-#endif /* HAVE_LOCKING */
+#endif /* _WIN32 */
/* We got an error. We don't want EACCES errors */
my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1;
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index d29cbcc5048..20e53a23ab5 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -30,20 +30,6 @@
uint thd_lib_detected= 0;
-/* To allow use of pthread_getspecific with two arguments */
-
-#ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
-#undef pthread_getspecific
-
-void *my_pthread_getspecific_imp(pthread_key_t key)
-{
- void *value;
- if (pthread_getspecific(key,(void *) &value))
- return 0;
- return value;
-}
-#endif
-
/*
Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7
(and DEC OSF/1 3.2 too)
@@ -51,18 +37,6 @@ void *my_pthread_getspecific_imp(pthread_key_t key)
int my_pthread_create_detached=1;
-#if defined(HAVE_NONPOSIX_SIGWAIT) || defined(HAVE_DEC_3_2_THREADS)
-
-int my_sigwait(const sigset_t *set,int *sig)
-{
- int signal=sigwait((sigset_t*) set);
- if (signal < 0)
- return errno;
- *sig=signal;
- return 0;
-}
-#endif
-
/* localtime_r for SCO 3.2V4.2 */
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
@@ -117,7 +91,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res)
** Author: Gary Wisniewski <garyw@spidereye.com.au>, much modified by Monty
****************************************************************************/
-#if !defined(HAVE_SIGWAIT) && !defined(sigwait) && !defined(__WIN__) && !defined(HAVE_rts_threads) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS)
+#if !defined(HAVE_SIGWAIT) && !defined(sigwait) && !defined(__WIN__) && !defined(HAVE_rts_threads)
#if !defined(DONT_USE_SIGSUSPEND)
@@ -269,13 +243,7 @@ void *sigwait_thread(void *set_arg)
for (;;)
{ /* Wait for signals */
-#ifdef HAVE_NOT_BROKEN_SELECT
- fd_set fd;
- FD_ZERO(&fd);
- select(0,&fd,0,0,0);
-#else
sleep(1); /* Because of broken BSDI */
-#endif
}
}
@@ -352,39 +320,6 @@ int sigwait(sigset_t *setp, int *sigp)
#undef pthread_attr_getstacksize
/*****************************************************************************
-** Patches for AIX and DEC OSF/1 3.2
-*****************************************************************************/
-
-#if defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT)
-
-#include <netdb.h>
-
-int my_pthread_mutex_noposix_init(pthread_mutex_t *mp,
- const pthread_mutexattr_t *attr)
-{
- int error;
- if (!attr)
- error=pthread_mutex_init(mp,pthread_mutexattr_default);
- else
- error=pthread_mutex_init(mp,*attr);
- return error;
-}
-
-int my_pthread_cond_noposix_init(pthread_cond_t *mp,
- const pthread_condattr_t *attr)
-{
- int error;
- if (!attr)
- error=pthread_cond_init(mp,pthread_condattr_default);
- else
- error=pthread_cond_init(mp,*attr);
- return error;
-}
-
-#endif
-
-
-/*****************************************************************************
Patches for HPUX
We need these because the pthread_mutex.. code returns -1 on error,
instead of the error code.
@@ -394,7 +329,7 @@ int my_pthread_cond_noposix_init(pthread_cond_t *mp,
this has to be added here.
****************************************************************************/
-#if defined(HPUX10) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT)
+#if defined(HPUX10)
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime)
diff --git a/mysys/my_rename.c b/mysys/my_rename.c
index 6704d7c87d0..b89bc4c8fbd 100644
--- a/mysys/my_rename.c
+++ b/mysys/my_rename.c
@@ -27,22 +27,6 @@ int my_rename(const char *from, const char *to, myf MyFlags)
DBUG_ENTER("my_rename");
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
-#if defined(HAVE_FILE_VERSIONS)
- { /* Check that there isn't a old file */
- int save_errno;
- MY_STAT my_stat_result;
- save_errno=my_errno;
- if (my_stat(to,&my_stat_result,MYF(0)))
- {
- my_errno=EEXIST;
- error= -1;
- if (MyFlags & MY_FAE+MY_WME)
- my_error(EE_LINK, MYF(ME_BELL+ME_WAITTANG),from,to,my_errno);
- DBUG_RETURN(error);
- }
- my_errno=save_errno;
- }
-#endif
#if defined(HAVE_RENAME)
#if defined(__WIN__)
/*
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 45f4220c835..17cda782b30 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -43,9 +43,6 @@
#undef pthread_cond_wait
#undef pthread_cond_timedwait
#undef safe_mutex_free_deadlock_data
-#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
-#define pthread_mutex_init(a,b) my_pthread_noposix_mutex_init((a),(b))
-#endif
#endif /* DO_NOT_REMOVE_THREAD_WRAPPERS */
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index c01aebf99f9..063567388aa 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -106,7 +106,7 @@
/* We have HAVE_valgrind below as this speeds up the shutdown of MySQL */
-#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_valgrind) && defined(__linux__)
+#if defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_valgrind) && defined(__linux__)
#define HAVE_CLOSE_SERVER_SOCK 1
#endif
@@ -2927,11 +2927,9 @@ static void start_signal_handler(void)
DBUG_ENTER("start_signal_handler");
(void) pthread_attr_init(&thr_attr);
-#if !defined(HAVE_DEC_3_2_THREADS)
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
(void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
(void) my_setstacksize(&thr_attr,my_thread_stack_size);
-#endif
mysql_mutex_lock(&LOCK_thread_count);
if ((error= mysql_thread_create(key_thread_signal_hand,
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 37f28844a7c..edc33c4d63b 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -138,23 +138,6 @@ extern "C" sig_handler handle_fatal_signal(int sig)
my_safe_printf_stderr("%s",
"Hope that's ok; if not, decrease some variables in the equation.\n\n");
-#if defined(HAVE_LINUXTHREADS)
-#define UNSAFE_DEFAULT_LINUX_THREADS 200
- if (sizeof(char*) == 4 && thread_count > UNSAFE_DEFAULT_LINUX_THREADS)
- {
- my_safe_printf_stderr(
- "You seem to be running 32-bit Linux and have "
- "%d concurrent connections.\n"
- "If you have not changed STACK_SIZE in LinuxThreads "
- "and built the binary \n"
- "yourself, LinuxThreads is quite likely to steal "
- "a part of the global heap for\n"
- "the thread stack. Please read "
- "http://dev.mysql.com/doc/mysql/en/linux-installation.html\n\n"
- thread_count);
- }
-#endif /* HAVE_LINUXTHREADS */
-
#ifdef HAVE_STACKTRACE
thd= current_thd;
diff --git a/sql/spatial.h b/sql/spatial.h
index 0d0560656f0..07675d59040 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -554,5 +554,5 @@ public:
struct Geometry_buffer : public
my_aligned_storage<sizeof(Gis_point), MY_ALIGNOF(Gis_point)> {};
-#endif /*HAVE_SPATAIAL*/
+#endif /*HAVE_SPATIAL*/
#endif
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 54f94ce78c1..e0d0d4c4223 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2781,9 +2781,6 @@ pthread_handler_t handle_delayed_insert(void *arg)
{
int error;
mysql_audit_release(thd);
-#if defined(HAVE_BROKEN_COND_TIMEDWAIT)
- error= mysql_cond_wait(&di->cond, &di->mutex);
-#else
error= mysql_cond_timedwait(&di->cond, &di->mutex, &abstime);
#ifdef EXTRA_DEBUG
if (error && error != EINTR && error != ETIMEDOUT)
@@ -2793,7 +2790,6 @@ pthread_handler_t handle_delayed_insert(void *arg)
error));
}
#endif
-#endif
if (error == ETIMEDOUT || error == ETIME)
thd->killed= KILL_CONNECTION;
}
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index 2e93912fb25..7705f6ca476 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -287,5 +287,5 @@ public:
int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
};
-# endif /* HAVE_PROFILING */
+# endif /* ENABLED_PROFILING */
#endif /* _SQL_PROFILE_H */
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index 27653ae5574..62225a7a4b0 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -21,9 +21,6 @@
#include <m_ctype.h>
#include <stdarg.h>
#include <my_getopt.h>
-#ifdef HAVE_SYS_VADVICE_H
-#include <sys/vadvise.h>
-#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index 92d7459dfc5..dab1f66ed6d 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -330,9 +330,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (!share->temporary)
flush_key_blocks(share->key_cache, share->kfile, &share->dirty_part_map,
FLUSH_KEEP);
-#ifdef HAVE_PWRITE
_mi_decrement_open_count(info);
-#endif
if (share->not_flushed)
{
share->not_flushed=0;
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index fa8cc679997..7d8b577e8b0 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -20,9 +20,6 @@
#include <stdarg.h>
#include <my_getopt.h>
#include <my_bit.h>
-#ifdef HAVE_SYS_VADVICE_H
-#include <sys/vadvise.h>
-#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
diff --git a/unittest/mysys/ma_dyncol-t.c b/unittest/mysys/ma_dyncol-t.c
index 11731ae81d4..4a9b687bc08 100644
--- a/unittest/mysys/ma_dyncol-t.c
+++ b/unittest/mysys/ma_dyncol-t.c
@@ -194,7 +194,7 @@ static CHARSET_INFO *charset_list[]=
#endif
#ifdef HAVE_CHARSET_utf8
&my_charset_utf8_general_ci,
-#ifdef HAVE_HAVE_UCA_COLLATIONS
+#ifdef HAVE_UCA_COLLATIONS
&my_charset_utf8_unicode_ci,
#endif
&my_charset_utf8_bin,
diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c
index 7e61cb8722e..6baef0417a8 100644
--- a/unittest/strings/strings-t.c
+++ b/unittest/strings/strings-t.c
@@ -87,7 +87,7 @@ static CHARSET_INFO *charset_list[]=
#endif
#ifdef HAVE_CHARSET_utf8
&my_charset_utf8_general_ci,
-#ifdef HAVE_HAVE_UCA_COLLATIONS
+#ifdef HAVE_UCA_COLLATIONS
&my_charset_utf8_unicode_ci,
#endif
&my_charset_utf8_bin,