Permalink
Browse files

Fixed use of PyAPI_FUNC.

  • Loading branch information...
Stewori committed Jun 29, 2017
1 parent 76c8a30 commit b169314138ceddae79ddca29effb43b25275ed90
Showing with 11 additions and 18 deletions.
  1. +1 −1 JyNI-C/src/Python/_warnings.c
  2. +8 −15 JyNI-C/src/Python/thread_JyNI.c
  3. +1 −1 makefile.win
  4. +1 −1 makefile.wine
@@ -785,7 +785,7 @@ PyErr_WarnEx(PyObject *category, const char *text, Py_ssize_t stack_level)
#undef PyErr_Warn
int //PyAPI_FUNC(int)
PyAPI_FUNC(int)
PyErr_Warn(PyObject *category, char *text)
{
return PyErr_WarnEx(category, text, 1);
@@ -37,55 +37,48 @@
#include <JyNI.h>
#include <pythread_JyNI.h>
//PyAPI_FUNC(void) PyThread_init_thread(void);
static void PyThread__init_thread(void)
PyAPI_FUNC(void) PyThread__init_thread(void)
{
}
//PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *)
long PyThread_start_new_thread(void (*func) (void *), void *arg)
PyAPI_FUNC(long) PyThread_start_new_thread(void (*func) (void *), void *arg)
{
//todo: Implement
return 0;
}
//PyAPI_FUNC(void) PyThread_exit_thread(void)
void PyThread_exit_thread(void)
PyAPI_FUNC(void) PyThread_exit_thread(void)
{
//todo: Implement
}
//PyAPI_FUNC(long) PyThread_get_thread_ident(void)
long PyThread_get_thread_ident(void)
PyAPI_FUNC(long) PyThread_get_thread_ident(void)
{
env(0);
return (long) (*env)->CallStaticLongMethod(env, JyNIClass, JyNI_getCurrentThreadID);
}
//PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void)
PyThread_type_lock PyThread_allocate_lock(void)
PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void)
{
env(NULL);
return (PyThread_type_lock) (*env)->NewGlobalRef(env, (*env)->NewObject(env, JyLockClass, JyLock_Constructor));
}
//PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock lock)
void PyThread_free_lock(PyThread_type_lock lock)
PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock lock)
{
env();
(*env)->DeleteGlobalRef(env, (jobject) lock);
}
//PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
{
env(0);
return (*env)->CallBooleanMethod(env, (jobject) lock, JyLock_acquire, waitflag);//waitflag == WAIT_LOCK);
}
//PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock lock)
void PyThread_release_lock(PyThread_type_lock lock)
PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock lock)
{
env();
(*env)->CallVoidMethod(env, (jobject) lock, JyLock_release);
View
@@ -65,7 +65,7 @@ INCLUDES = /I $(PYTHON_HOME)\include /I $(VC_Python)\VC\Include /I $(VC_Python)\
#LIBS = $(PYTHON_HOME)/libs/python27.lib $(VC_Python)\VC\lib\libcmt.lib $(VC_Python)\VC\lib\OLDNAMES.lib $(VC_Python)\WinSDK\lib\Kernel32.lib
LIBS64 = $(PYTHON_HOME)/libs/python27.lib $(VC_Python)\VC\lib\amd64\libcmt.lib $(VC_Python)\VC\lib\amd64\OLDNAMES.lib $(VC_Python)\WinSDK\lib\x64\Kernel32.lib
CFLAGS = /w $(INCLUDES)
CFLAGS = /w $(INCLUDES) /DPy_BUILD_CORE
# You can optionally remove -source 1.7 -target 1.7. It's purpose is to achieve maximal compatibility by default.
JFLAGS= -cp $(JYTHON):$(JYNI) -d $(JYNIBIN) -source 1.7 -target 1.7
View
@@ -69,7 +69,7 @@ INCLUDES = /I$(VC_Python)/VC/Include /I$(VC_Python)/WinSDK/Include $(JYNI_INCLUD
#LIBS = $(PYTHON_HOME)/libs/python27.lib $(VC_Python)\VC\lib\libcmt.lib $(VC_Python)\VC\lib\OLDNAMES.lib $(VC_Python)\WinSDK\lib\Kernel32.lib
LIBS64 = $(PYTHON_HOME)/libs/python27.lib $(VC_Python)\VC\lib\amd64\libcmt.lib $(VC_Python)\VC\lib\amd64\OLDNAMES.lib $(VC_Python)\WinSDK\lib\x64\Kernel32.lib
CFLAGS = /w $(INCLUDES)
CFLAGS = /w $(INCLUDES) /DPy_BUILD_CORE
# You can optionally remove -source 1.7 -target 1.7. It's purpose is to achieve maximal compatibility by default.
JFLAGS= -cp $(JYTHON):$(JYNI) -d $(JYNIBIN) -source 1.7 -target 1.7

0 comments on commit b169314

Please sign in to comment.