List:Commits« Previous MessageNext Message »
From:antony Date:August 2 2007 9:48pm
Subject:bk commit into 5.2 tree (antony:1.2566) BUG#29640
View as plain text  
Below is the list of changes that have just been committed into a local
5.2 repository of antony. When antony does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-08-02 14:48:21-07:00, antony@stripped +2 -0
  bug#29640
    "log2() is not available on many Unix dialects or older versions"
    Add check for existance of log2() function after checking for
    existance of libm.
    Declare a macro which approximates log2() if it does not exist.
    Tested on FreeBSD 6.2 which does not have a log2() implementation.

  configure.in@stripped, 2007-08-02 14:48:17-07:00, antony@stripped +1 -0
    bug29640
      Add check for existance of log2() function after checking for
      existance of libm.

  include/my_global.h@stripped, 2007-08-02 14:48:18-07:00, antony@stripped +8 -0
    bug29640
      If log2() does not exist, declare a macro which approximates it.

diff -Nrup a/configure.in b/configure.in
--- a/configure.in	2007-08-01 09:21:28 -07:00
+++ b/configure.in	2007-08-02 14:48:17 -07:00
@@ -757,6 +757,7 @@ AC_CHECK_HEADERS([xfs/xfs.h])
 #--------------------------------------------------------------------
 
 AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
+AC_CHECK_FUNCS(log2)
 
 AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
   AC_CHECK_LIB(nsl, gethostbyname_r))
diff -Nrup a/include/my_global.h b/include/my_global.h
--- a/include/my_global.h	2007-07-04 16:01:50 -07:00
+++ b/include/my_global.h	2007-08-02 14:48:18 -07:00
@@ -886,6 +886,14 @@ typedef SOCKET_SIZE_TYPE size_socket;
 #define M_LN2 0.69314718055994530942
 #endif
 
+#ifndef HAVE_LOG2
+/*
+  This will be slightly slower and perhaps a tiny bit less accurate than
+  doing it the IEEE754 way but log2() should be available on C99 systems.
+*/
+#define log2(X) (log(X) / M_LN2)
+#endif
+
 /*
   Max size that must be added to a so that we know Size to make
   adressable obj.
Thread
bk commit into 5.2 tree (antony:1.2566) BUG#29640antony2 Aug