List:Commits« Previous MessageNext Message »
From:holyfoot Date:January 15 2007 8:53am
Subject:bk commit into 5.0 tree (holyfoot:1.2377) BUG#15498
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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-01-15 11:53:31+04:00, holyfoot@stripped +2 -0
  bug #15498 UDF 'cosh' is never called
  
  The problem is mainly about the Windows linker.
  If the file includes 'math.h', it can't define math function
  like 'cosh' (see 'cosh' help page in MSDN for example).
  C++ makes it possible to have 'cosh' in the file, but
  it because C++ internally renames functions, so
  if one exports 'cosh' in dll, he's going to export
  mathlib's 'cosh', not the user-defined one.
  
  Solution here is to make possible to exclude 'math.h' from headers with
  MYSQL_NO_MATH_H macrodefinition.
  Like that: (user's my_cosh.cpp)
  
  #define MYSQL_NO_MATH_H
  #include <my_global.h>
  #include <mysql.h>
  ...
  double cosh(UDF_INIT *initid ...)
  my_bool cosh_init(UDF_INIT *initid ...)

  include/config-win.h@stripped, 2007-01-15 11:53:30+04:00, holyfoot@stripped +5 -0
    now it's possible to avoid 'math.h'

  include/my_global.h@stripped, 2007-01-15 11:53:30+04:00, holyfoot@stripped +3 -0
    now it's possible to avoid 'math.h'

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	holyfoot
# Host:	hfmain.(none)
# Root:	/home/hf/work/15498/my50-15498

--- 1.82/include/config-win.h	2007-01-15 11:53:35 +04:00
+++ 1.83/include/config-win.h	2007-01-15 11:53:35 +04:00
@@ -28,7 +28,10 @@ functions */
 
 #include <sys/locking.h>
 #include <windows.h>
+#ifndef MYSQL_NO_MATH_H
 #include <math.h>			/* Because of rint() */
+#endif
+
 #include <fcntl.h>
 #include <io.h>
 #include <malloc.h>
@@ -221,12 +224,14 @@ typedef uint rf_SetTimer;
 #define inline __inline
 #endif /* __cplusplus */
 
+#ifndef MYSQL_NO_MATH_H
 inline double rint(double nr)
 {
   double f = floor(nr);
   double c = ceil(nr);
   return (((c-nr) >= (nr-f)) ? f :c);
 }
+#endif /*!MYSQL_NO_MATH_H*/
 
 #ifdef _WIN64
 #define ulonglong2double(A) ((double) (ulonglong) (A))

--- 1.132/include/my_global.h	2007-01-15 11:53:35 +04:00
+++ 1.133/include/my_global.h	2007-01-15 11:53:35 +04:00
@@ -309,7 +309,10 @@ C_MODE_END
 #include <stddef.h>
 #endif
 
+#ifndef MYSQL_NO_MATH_H
 #include <math.h>
+#endif
+
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
Thread
bk commit into 5.0 tree (holyfoot:1.2377) BUG#15498holyfoot15 Jan