Add cast to int in yaz_log call (%.*s)
[simpleserver-moved-to-github.git] / SimpleServer.xs
index 59ac45f..ab9b336 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: SimpleServer.xs,v 1.82 2008-08-29 18:58:40 mike Exp $ 
+ * $Id: SimpleServer.xs,v 1.84 2009-08-10 08:01:28 adam Exp $ 
  * ----------------------------------------------------------------------
  * 
  * Copyright (c) 2000-2004, Index Data.
@@ -1428,6 +1428,21 @@ int bend_explain(void *handle, bend_explain_rr *q)
         return 0;
 }
 
+
+/*
+ * You'll laugh when I tell you this ...  Astonishingly, it turns out
+ * that ActivePerl (which is widely used on Windows) has, in the
+ * header file Perl\lib\CORE\XSUB.h, the following heinous crime:
+ *         #    define open            PerlLIO_open
+ * This of course screws up the use of the "open" member of the
+ * Z_IdAuthentication structure below, so we have to undo this
+ * brain-damage.
+ */
+#ifdef open
+#undef open
+#endif
+
+
 bend_initresult *bend_init(bend_initrequest *q)
 {
        int dummy = simpleserver_clone();
@@ -1741,7 +1756,7 @@ yazlog(arg)
                STRLEN len;
                char *ptr;
                ptr = SvPV(arg, len);
-               yaz_log(YLOG_LOG, "%.*s", len, ptr);
+               yaz_log(YLOG_LOG, "%.*s", (int) len, ptr);
 
 int
 yaz_diag_srw_to_bib1(srw_code)