Changeset: 94812019e9d5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=94812019e9d5
Modified Files:
monetdb5/extras/pyapi/pyapi.c
monetdb5/extras/pyapi/pyapi.h
Branch: pyapi
Log Message:
made it compile on fedora 21
diffs (72 lines):
diff --git a/monetdb5/extras/pyapi/pyapi.c b/monetdb5/extras/pyapi/pyapi.c
--- a/monetdb5/extras/pyapi/pyapi.c
+++ b/monetdb5/extras/pyapi/pyapi.c
@@ -16,6 +16,9 @@
#include "pyapi.h"
+#undef _GNU_SOURCE
+#undef _XOPEN_SOURCE
+#undef _POSIX_C_SOURCE
#include <Python.h>
// other headers
@@ -66,7 +69,7 @@ str PyAPIeval(MalBlkPtr mb, MalStkPtr st
str *args;
//int evalErr;
char *msg = MAL_SUCCEED;
- BAT *b;
+ BAT *b = NULL;
BUN cnt;
node * argnode;
int seengrp = FALSE;
@@ -120,6 +123,9 @@ str PyAPIeval(MalBlkPtr mb, MalStkPtr st
// for each input column (BAT):
for (i = pci->retc + 2; i < pci->argc; i++) {
+ PyObject *varlist = NULL;
+ size_t j;
+
// turn scalars into one-valued BATs
// TODO: also do this for Python? Or should scalar values be
'simple' variables?
if (!isaBatType(getArgType(mb,pci,i))) {
@@ -143,9 +149,7 @@ str PyAPIeval(MalBlkPtr mb, MalStkPtr st
}
}
- PyObject *varlist = PyList_New(BATcount(b));
- size_t j;
-
+ varlist = PyList_New(BATcount(b));
switch (ATOMstorage(getColumnType(getArgType(mb,pci,i)))) {
case TYPE_int:
// BAT_TO_INTSXP(b, int, varvalue);
@@ -245,8 +249,7 @@ str PyAPIeval(MalBlkPtr mb, MalStkPtr st
*getArgReference_bat(stk, pci, i) = b->batCacheid;
BBPkeepref(b->batCacheid);
} else { // single value return, only for non-grouped
aggregations
- VALinit(&stk->stk[pci->argv[i]], bat_type,
- Tloc(b, BUNfirst(b)));
+ VALinit(&stk->stk[pci->argv[i]], bat_type, Tloc(b,
BUNfirst(b)));
}
msg = MAL_SUCCEED;
}
diff --git a/monetdb5/extras/pyapi/pyapi.h b/monetdb5/extras/pyapi/pyapi.h
--- a/monetdb5/extras/pyapi/pyapi.h
+++ b/monetdb5/extras/pyapi/pyapi.h
@@ -17,7 +17,15 @@
#include "mal_exception.h"
#include "mal_interpreter.h"
+#ifdef WIN32
+#ifndef LIBPYAPI
+#define pyapi_export extern __declspec(dllimport)
+#else
+#define pyapi_export extern __declspec(dllexport)
+#endif
+#else
#define pyapi_export extern
+#endif
pyapi_export str PyAPIevalStd(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
pyapi_export str PyAPIevalAggr(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list