Skip to content

Commit

Permalink
Fix for CORE-3156: Problems using UDFs on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPeshkoff committed Oct 4, 2010
1 parent 07f427c commit 0018ec6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/extlib/ib_udf.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -405,7 +407,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
Expand Down

0 comments on commit 0018ec6

Please sign in to comment.