From 78ca999d4a937e543d0a76429a54a0ae195f3e9c Mon Sep 17 00:00:00 2001 From: paulbeach Date: Tue, 5 Oct 2010 12:43:24 +0000 Subject: [PATCH] Fix for UDFs on Darwin --- builds/posix/darwin.defaults | 2 +- src/extlib/ib_udf.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/builds/posix/darwin.defaults b/builds/posix/darwin.defaults index f92dc94c0b..9df4963bec 100644 --- a/builds/posix/darwin.defaults +++ b/builds/posix/darwin.defaults @@ -40,7 +40,7 @@ PLATFORM_POSTBUILD_TARGET=darwin_postbuild_target # Per-library link rules LINK_UDF = $(LIB_LINK) $(LIB_BUNDLE_OPTIONS) -L$(LIB) -LINK_UDF_LIBS = -lm -lib_util $(THR_FLAGS) $(THR_LIBS) +LINK_UDF_LIBS = -lm $(THR_FLAGS) $(THR_LIBS) LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS)\ $(LIB_LINK_RPATH) $(LIB_LINK_SONAME) diff --git a/src/extlib/ib_udf.cpp b/src/extlib/ib_udf.cpp index d5311a0c94..e9ed71b1b9 100644 --- a/src/extlib/ib_udf.cpp +++ b/src/extlib/ib_udf.cpp @@ -58,6 +58,8 @@ int MATHERR(struct exception_type*) #endif // SOLARIS #endif //__ICC +typedef char* pChar; + double EXPORT IB_UDF_abs( double *a) { return (*a < 0.0) ? -*a : *a; @@ -68,7 +70,7 @@ double EXPORT IB_UDF_acos( double *a) return (acos(*a)); } -char *EXPORT IB_UDF_ascii_char( ISC_LONG *a) +pChar EXPORT IB_UDF_ascii_char( ISC_LONG *a) { if (!a) return 0; @@ -185,7 +187,7 @@ double EXPORT IB_UDF_log10( double *a) return (log10(*a)); } -char *EXPORT IB_UDF_lower(const char *s) +pChar EXPORT IB_UDF_lower(const char *s) { if (!s) return 0; @@ -205,7 +207,7 @@ char *EXPORT IB_UDF_lower(const char *s) return buf; } -char *EXPORT IB_UDF_lpad( const char *s, ISC_LONG *a, const char *c) +pChar EXPORT IB_UDF_lpad( const char *s, ISC_LONG *a, const char *c) { if (!s || !c) return 0; @@ -241,7 +243,7 @@ char *EXPORT IB_UDF_lpad( const char *s, ISC_LONG *a, const char *c) return NULL; } -char *EXPORT IB_UDF_ltrim( const char *s) +pChar EXPORT IB_UDF_ltrim( const char *s) { if (!s) return 0; @@ -293,7 +295,7 @@ double EXPORT IB_UDF_rand() return ((float) rand() / (float) RAND_MAX); } -char *EXPORT IB_UDF_rpad( const char *s, ISC_LONG *a, const char *c) +pChar EXPORT IB_UDF_rpad( const char *s, ISC_LONG *a, const char *c) { if (!s || !c) return 0; @@ -327,7 +329,7 @@ char *EXPORT IB_UDF_rpad( const char *s, ISC_LONG *a, const char *c) return NULL; } -char *EXPORT IB_UDF_rtrim( const char *s) +pChar EXPORT IB_UDF_rtrim( const char *s) { if (!s) return 0; @@ -369,7 +371,7 @@ double EXPORT IB_UDF_sqrt( double *a) return (sqrt(*a)); } -char* EXPORT IB_UDF_substr(const char* s, ISC_SHORT* m, ISC_SHORT* n) +pChar EXPORT IB_UDF_substr(const char* s, ISC_SHORT* m, ISC_SHORT* n) { if (!s) { return 0; @@ -403,7 +405,7 @@ char* EXPORT IB_UDF_substr(const char* s, ISC_SHORT* m, ISC_SHORT* n) return buf; } -char* EXPORT IB_UDF_substrlen(const char* s, ISC_SHORT* m, ISC_SHORT* n) +pChar EXPORT IB_UDF_substrlen(const char* s, ISC_SHORT* m, ISC_SHORT* n) { /* Created by Claudio Valderrama for the Firebird project, 2001.04.17 We don't want to return NULL when params are wrong