summaryrefslogtreecommitdiff
path: root/sql/udf_example.c
diff options
context:
space:
mode:
authorgeorg@lmy002.wdf.sap.corp <>2006-09-22 14:42:43 +0200
committergeorg@lmy002.wdf.sap.corp <>2006-09-22 14:42:43 +0200
commit67a701003c5754ca87ff802ffed91e6276a89b4c (patch)
treee6aa73996f37344a3342e05e97615ac41339ba56 /sql/udf_example.c
parentca00ba4991aae1de9b06e1234c12c10ea9a410ea (diff)
downloadmariadb-git-67a701003c5754ca87ff802ffed91e6276a89b4c.tar.gz
Fix for bug #19121: Windows incompatible udf_example
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);