summaryrefslogtreecommitdiff
path: root/sql/udf_example.c
diff options
context:
space:
mode:
authorunknown <georg@lmy002.wdf.sap.corp>2006-09-22 14:42:43 +0200
committerunknown <georg@lmy002.wdf.sap.corp>2006-09-22 14:42:43 +0200
commit0c5d362750de372916ba65320e30316940e3733b (patch)
treee6aa73996f37344a3342e05e97615ac41339ba56 /sql/udf_example.c
parentfcd21bd4ad5b1837ab292880bf113894488b45bb (diff)
downloadmariadb-git-0c5d362750de372916ba65320e30316940e3733b.tar.gz
Fix for bug #19121: Windows incompatible udf_example
mysql-test/mysql-test-run.pl: fixed path for udf_example.so when running testsuite on Windows sql/CMakeLists.txt: Added missing udf_example sql/Makefile.am: Added udf_example files for make dist sql/udf_example.c: fix for Windows: Windows doesn't have socket.h and friends Added replacements for strmov,bzero and memcpy_fixed when compiling standalone. sql/udf_example.def: BitKeeper file /home/georg/work/mysql/prod/mysql-5.0-win/sql/udf_example.def
Diffstat (limited to 'sql/udf_example.c')
-rw-r--r--sql/udf_example.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/udf_example.c b/sql/udf_example.c
index a80fce81278..2fa7474eb16 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -127,7 +127,14 @@ typedef long long longlong;
#else
#include <my_global.h>
#include <my_sys.h>
+#if defined(MYSQL_SERVER)
#include <m_string.h> /* To get strmov() */
+#else
+/* when compiled as standalone */
+#define strmov(a,b) strcpy(a,b)
+#define bzero(a,b) memset(a,0,b)
+#define memcpy_fixed(a,b,c) memcpy(a,b,c)
+#endif
#endif
#include <mysql.h>
#include <ctype.h>
@@ -674,10 +681,14 @@ longlong sequence(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
**
****************************************************************************/
+#ifdef __WIN__
+#include <winsock.h>
+#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#endif
my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
void lookup_deinit(UDF_INIT *initid);