Commit 7d8038b343fb7649b0d46f9e0630e9938ceda258
1 parent
b44a00b3
Exists in
master
Trying to fix segfault in windows exception.
Showing
4 changed files
with
10 additions
and
16 deletions
Show diff stats
configure.ac
@@ -85,10 +85,6 @@ AC_SUBST(PACKAGE_REVISION,$app_cv_revision) | @@ -85,10 +85,6 @@ AC_SUBST(PACKAGE_REVISION,$app_cv_revision) | ||
85 | AC_SUBST(PACKAGE_MAJOR_RELEASE,$app_rls_major) | 85 | AC_SUBST(PACKAGE_MAJOR_RELEASE,$app_rls_major) |
86 | AC_SUBST(PACKAGE_MINOR_RELEASE,$app_rls_minor) | 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 | dnl --------------------------------------------------------------------------- | 88 | dnl --------------------------------------------------------------------------- |
93 | dnl Check for OS specifics | 89 | dnl Check for OS specifics |
94 | dnl --------------------------------------------------------------------------- | 90 | dnl --------------------------------------------------------------------------- |
@@ -148,6 +144,10 @@ AC_PATH_TOOL([ZIP], [zip], [zip]) | @@ -148,6 +144,10 @@ AC_PATH_TOOL([ZIP], [zip], [zip]) | ||
148 | 144 | ||
149 | PKG_CHECK_EXISTS | 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 | dnl --------------------------------------------------------------------------- | 151 | dnl --------------------------------------------------------------------------- |
152 | dnl Check for C++ 2011 support | 152 | dnl Check for C++ 2011 support |
153 | dnl --------------------------------------------------------------------------- | 153 | dnl --------------------------------------------------------------------------- |
setup.py
@@ -18,10 +18,6 @@ if platform.system() == 'Windows': | @@ -18,10 +18,6 @@ if platform.system() == 'Windows': | ||
18 | 18 | ||
19 | tn3270 = Extension( | 19 | tn3270 = Extension( |
20 | 'tn3270', | 20 | 'tn3270', |
21 | - define_macros = [ | ||
22 | - ('TN3270_MODULE_NAME', 'python3-tn3270'), | ||
23 | - ('TN3270_MODULE_VERSION', '5.2') | ||
24 | - ], | ||
25 | include_dirs = include_dirs, | 21 | include_dirs = include_dirs, |
26 | libraries = ['ipc3270'], | 22 | libraries = ['ipc3270'], |
27 | library_dirs=library_dirs, | 23 | library_dirs=library_dirs, |
@@ -57,6 +53,6 @@ setup ( name = 'tn3270', | @@ -57,6 +53,6 @@ setup ( name = 'tn3270', | ||
57 | long_description = ''' | 53 | long_description = ''' |
58 | This is an extension allowing tn3270 acess for python applications | 54 | This is an extension allowing tn3270 acess for python applications |
59 | using lib3270 directly or ipc calls to an enabled pw3270 window. | 55 | using lib3270 directly or ipc calls to an enabled pw3270 window. |
60 | -''', | 56 | +''', |
61 | ext_modules = [ tn3270 ]) | 57 | ext_modules = [ tn3270 ]) |
62 | 58 |
src/module/properties.cc
@@ -33,20 +33,18 @@ | @@ -33,20 +33,18 @@ | ||
33 | /*---[ Implement ]----------------------------------------------------------------------------------*/ | 33 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
34 | 34 | ||
35 | PyObject * py3270_get_module_version(PyObject *self, PyObject *args) { | 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 | return PyUnicode_FromString(PACKAGE_VERSION); | 37 | return PyUnicode_FromString(PACKAGE_VERSION); |
40 | #else | 38 | #else |
41 | - return PyUnicode_FromString(""); | 39 | + return PyUnicode_FromString(TN3270::getVersion()); |
42 | #endif // PACKAGE_VERSION | 40 | #endif // PACKAGE_VERSION |
43 | } | 41 | } |
44 | 42 | ||
45 | PyObject * py3270_get_module_revision(PyObject *self, PyObject *args) { | 43 | PyObject * py3270_get_module_revision(PyObject *self, PyObject *args) { |
46 | #ifdef PACKAGE_REVISION | 44 | #ifdef PACKAGE_REVISION |
47 | - return PyLong_FromLong(PACKAGE_REVISION); | 45 | + return PyUnicode_FromString(LIB3270_STRINGIZE_VALUE_OF(PACKAGE_REVISION)); |
48 | #else | 46 | #else |
49 | - return PyLong_FromLong(0); | 47 | + return PyUnicode_FromString(TN3270::getRevision()); |
50 | #endif // PACKAGE_REVISION | 48 | #endif // PACKAGE_REVISION |
51 | } | 49 | } |
52 | 50 |
src/module/windows/init.cc
@@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
82 | switch(dwcallpurpose) { | 82 | switch(dwcallpurpose) { |
83 | case DLL_PROCESS_ATTACH: | 83 | case DLL_PROCESS_ATTACH: |
84 | hModule = hInstance; | 84 | hModule = hInstance; |
85 | - hEventLog = RegisterEventSource(NULL, LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME)); | 85 | + hEventLog = RegisterEventSource(NULL, PACKAGE_NAME); |
86 | break; | 86 | break; |
87 | 87 | ||
88 | case DLL_PROCESS_DETACH: | 88 | case DLL_PROCESS_DETACH: |