Commit 7d8038b343fb7649b0d46f9e0630e9938ceda258

Authored by Perry Werneck
1 parent b44a00b3
Exists in master

Trying to fix segfault in windows exception.

configure.ac
... ... @@ -85,10 +85,6 @@ AC_SUBST(PACKAGE_REVISION,$app_cv_revision)
85 85 AC_SUBST(PACKAGE_MAJOR_RELEASE,$app_rls_major)
86 86 AC_SUBST(PACKAGE_MINOR_RELEASE,$app_rls_minor)
87 87  
88   -AC_ARG_WITH([product-name], [AS_HELP_STRING([--with-product-name], [Set product name])], [ app_cv_product="$withval" ],[ app_cv_product=`$PKG_CONFIG --variable=product_name ipc3270` ])
89   -AC_DEFINE_UNQUOTED(PRODUCT_NAME, $app_cv_product)
90   -AC_SUBST(PRODUCT_NAME,$app_cv_product)
91   -
92 88 dnl ---------------------------------------------------------------------------
93 89 dnl Check for OS specifics
94 90 dnl ---------------------------------------------------------------------------
... ... @@ -148,6 +144,10 @@ AC_PATH_TOOL([ZIP], [zip], [zip])
148 144  
149 145 PKG_CHECK_EXISTS
150 146  
  147 +AC_ARG_WITH([product-name], [AS_HELP_STRING([--with-product-name], [Set product name])], [ app_cv_product="$withval" ],[ app_cv_product=`$PKG_CONFIG --variable=product_name lib3270` ])
  148 +AC_DEFINE_UNQUOTED(PRODUCT_NAME, $app_cv_product)
  149 +AC_SUBST(PRODUCT_NAME,$app_cv_product)
  150 +
151 151 dnl ---------------------------------------------------------------------------
152 152 dnl Check for C++ 2011 support
153 153 dnl ---------------------------------------------------------------------------
... ...
setup.py
... ... @@ -18,10 +18,6 @@ if platform.system() == 'Windows':
18 18  
19 19 tn3270 = Extension(
20 20 'tn3270',
21   - define_macros = [
22   - ('TN3270_MODULE_NAME', 'python3-tn3270'),
23   - ('TN3270_MODULE_VERSION', '5.2')
24   - ],
25 21 include_dirs = include_dirs,
26 22 libraries = ['ipc3270'],
27 23 library_dirs=library_dirs,
... ... @@ -57,6 +53,6 @@ setup ( name = 'tn3270',
57 53 long_description = '''
58 54 This is an extension allowing tn3270 acess for python applications
59 55 using lib3270 directly or ipc calls to an enabled pw3270 window.
60   -''',
  56 +''',
61 57 ext_modules = [ tn3270 ])
62 58  
... ...
src/module/properties.cc
... ... @@ -33,20 +33,18 @@
33 33 /*---[ Implement ]----------------------------------------------------------------------------------*/
34 34  
35 35 PyObject * py3270_get_module_version(PyObject *self, PyObject *args) {
36   -#if defined(TN3270_MODULE_VERSION)
37   - return PyUnicode_FromString(LIB3270_STRINGIZE_VALUE_OF(TN3270_MODULE_VERSION));
38   -#elif defined(PACKAGE_VERSION)
  36 +#if defined(PACKAGE_VERSION)
39 37 return PyUnicode_FromString(PACKAGE_VERSION);
40 38 #else
41   - return PyUnicode_FromString("");
  39 + return PyUnicode_FromString(TN3270::getVersion());
42 40 #endif // PACKAGE_VERSION
43 41 }
44 42  
45 43 PyObject * py3270_get_module_revision(PyObject *self, PyObject *args) {
46 44 #ifdef PACKAGE_REVISION
47   - return PyLong_FromLong(PACKAGE_REVISION);
  45 + return PyUnicode_FromString(LIB3270_STRINGIZE_VALUE_OF(PACKAGE_REVISION));
48 46 #else
49   - return PyLong_FromLong(0);
  47 + return PyUnicode_FromString(TN3270::getRevision());
50 48 #endif // PACKAGE_REVISION
51 49 }
52 50  
... ...
src/module/windows/init.cc
... ... @@ -82,7 +82,7 @@
82 82 switch(dwcallpurpose) {
83 83 case DLL_PROCESS_ATTACH:
84 84 hModule = hInstance;
85   - hEventLog = RegisterEventSource(NULL, LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME));
  85 + hEventLog = RegisterEventSource(NULL, PACKAGE_NAME);
86 86 break;
87 87  
88 88 case DLL_PROCESS_DETACH:
... ...