You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-commits@lucene.apache.org by va...@apache.org on 2010/04/12 21:33:15 UTC

svn commit: r933375 - in /lucene/pylucene/trunk/jcc: CHANGES jcc/sources/jcc.cpp setup.py

Author: vajda
Date: Mon Apr 12 19:33:14 2010
New Revision: 933375

URL: http://svn.apache.org/viewvc?rev=933375&view=rev
Log:
 - added JCC_VERSION string to modules using JCC

Modified:
    lucene/pylucene/trunk/jcc/CHANGES
    lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp
    lucene/pylucene/trunk/jcc/setup.py

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=933375&r1=933374&r2=933375&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Mon Apr 12 19:33:14 2010
@@ -15,6 +15,7 @@ Version 2.5 ->
  - added support for auto-boxing CharSequence from python str and unicode
  - added support for auto-boxing Number from python int, long and float
  - added 'asm' to list of reserved words
+ - added JCC_VERSION string to modules using JCC
  - 
 
 Version 2.4 -> 2.5

Modified: lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp?rev=933375&r1=933374&r2=933375&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/jcc.cpp Mon Apr 12 19:33:14 2010
@@ -304,6 +304,14 @@ _DLL_EXPORT PyObject *initJCC(PyObject *
         PyEval_InitThreads();
         INSTALL_TYPE(JCCEnv, module);
 
+#ifdef _MSC_VER
+#define verstring(n) #n
+        PyObject *ver = PyString_FromString(verstring(JCC_VER));
+#else
+        PyObject *ver = PyString_FromString(JCC_VER);
+#endif
+        PyObject_SetAttrString(module, "JCC_VERSION", ver); Py_DECREF(ver);
+
         if (env == NULL)
             env = new JCCEnv(NULL, NULL);
 
@@ -620,7 +628,7 @@ extern "C" {
     }
 };
 
-void JNICALL PythonException_getErrorInfo(JNIEnv *vm_env, jobject self)
+static void JNICALL _PythonException_getErrorInfo(JNIEnv *vm_env, jobject self)
 {
     PythonGIL gil(vm_env);
 
@@ -708,7 +716,7 @@ void JNICALL PythonException_getErrorInf
     PyErr_Restore(type, value, tb);
 }
 
-void JNICALL PythonException_clear(JNIEnv *vm_env, jobject self)
+static void JNICALL _PythonException_clear(JNIEnv *vm_env, jobject self)
 {
     PythonGIL gil(vm_env);
     PyErr_Clear();
@@ -718,8 +726,8 @@ static void registerNatives(JNIEnv *vm_e
 {
     jclass cls = vm_env->FindClass("org/apache/jcc/PythonException");
     JNINativeMethod methods[] = {
-        { "getErrorInfo", "()V", (void *) PythonException_getErrorInfo },
-        { "clear", "()V", (void *) PythonException_clear },
+        { "getErrorInfo", "()V", (void *) _PythonException_getErrorInfo },
+        { "clear", "()V", (void *) _PythonException_clear },
     };
 
     vm_env->RegisterNatives(cls, methods, 2);

Modified: lucene/pylucene/trunk/jcc/setup.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/setup.py?rev=933375&r1=933374&r2=933375&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/setup.py (original)
+++ lucene/pylucene/trunk/jcc/setup.py Mon Apr 12 19:33:14 2010
@@ -257,7 +257,8 @@ def main(debug):
 
         kwds = { "extra_compile_args": cflags,
                  "include_dirs": includes,
-                 "define_macros": [('_jcc_lib', None)],
+                 "define_macros": [('_jcc_lib', None),
+                                   ('JCC_VER', '"%s"' %(jcc_ver))],
                  "sources": sources[0:2] }
 
         if platform in ('darwin', 'ipod'):
@@ -299,7 +300,8 @@ def main(debug):
                                 extra_compile_args=cflags,
                                 extra_link_args=lflags,
                                 include_dirs=includes,
-                                define_macros=[('_java_generics', None)],
+                                define_macros=[('_java_generics', None),
+                                               ('JCC_VER', '"%s"' %(jcc_ver))],
                                 sources=sources))
 
     args = {