Commit 6a16861ab06beee658dba5807e6d270a1473c8dc
1 parent
e54afaf1
Exists in
master
and in
5 other branches
Compilando extensao rexx em windows
Showing
7 changed files
with
32 additions
and
22 deletions
Show diff stats
src/plugins/rx3270/local.cc
@@ -43,6 +43,14 @@ | @@ -43,6 +43,14 @@ | ||
43 | #include <stdarg.h> | 43 | #include <stdarg.h> |
44 | #endif // HAVE_SYSLOG | 44 | #endif // HAVE_SYSLOG |
45 | 45 | ||
46 | +// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx | ||
47 | +#ifndef LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | ||
48 | + #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 | ||
49 | +#endif // LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | ||
50 | + | ||
51 | +#ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | ||
52 | + #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 | ||
53 | +#endif // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | ||
46 | 54 | ||
47 | /*--[ Class definition ]-----------------------------------------------------------------------------*/ | 55 | /*--[ Class definition ]-----------------------------------------------------------------------------*/ |
48 | 56 | ||
@@ -96,7 +104,7 @@ | @@ -96,7 +104,7 @@ | ||
96 | void (*_set_toggle)(H3270 *h, LIB3270_TOGGLE ix, int value); | 104 | void (*_set_toggle)(H3270 *h, LIB3270_TOGGLE ix, int value); |
97 | 105 | ||
98 | #ifdef WIN32 | 106 | #ifdef WIN32 |
99 | - HMODULE hModule | 107 | + HMODULE hModule; |
100 | #else | 108 | #else |
101 | void * hModule; | 109 | void * hModule; |
102 | #endif // WIN32 | 110 | #endif // WIN32 |
@@ -376,7 +384,7 @@ dynamic::dynamic() | @@ -376,7 +384,7 @@ dynamic::dynamic() | ||
376 | fflush(stderr); | 384 | fflush(stderr); |
377 | dlclose(hModule); | 385 | dlclose(hModule); |
378 | #else | 386 | #else |
379 | - #error DLL close | 387 | + FreeLibrary(hModule); |
380 | #endif // !WIN32 | 388 | #endif // !WIN32 |
381 | hModule = NULL; | 389 | hModule = NULL; |
382 | return; | 390 | return; |
src/plugins/rx3270/pluginmain.cc
@@ -27,9 +27,9 @@ | @@ -27,9 +27,9 @@ | ||
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
30 | + #include "rx3270.h" | ||
30 | #include <pw3270/plugin.h> | 31 | #include <pw3270/plugin.h> |
31 | #include <lib3270/actions.h> | 32 | #include <lib3270/actions.h> |
32 | - #include "rx3270.h" | ||
33 | 33 | ||
34 | /*--[ Plugin session object ]--------------------------------------------------------------------------------*/ | 34 | /*--[ Plugin session object ]--------------------------------------------------------------------------------*/ |
35 | 35 |
src/plugins/rx3270/rexx_methods.cc
@@ -27,12 +27,10 @@ | @@ -27,12 +27,10 @@ | ||
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
30 | + #include "rx3270.h" | ||
30 | #include <time.h> | 31 | #include <time.h> |
31 | #include <string.h> | 32 | #include <string.h> |
32 | 33 | ||
33 | - #include "rx3270.h" | ||
34 | - | ||
35 | - | ||
36 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 34 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
37 | 35 | ||
38 | RexxMethod1(int, rx3270_method_init, CSTRING, type) | 36 | RexxMethod1(int, rx3270_method_init, CSTRING, type) |
src/plugins/rx3270/rx3270.h
@@ -31,18 +31,22 @@ | @@ -31,18 +31,22 @@ | ||
31 | 31 | ||
32 | #define RX3270_H_INCLUDED 1 | 32 | #define RX3270_H_INCLUDED 1 |
33 | 33 | ||
34 | + #include <lib3270/config.h> | ||
35 | + | ||
36 | + #ifdef HAVE_OOREXXAPI_H | ||
37 | + #ifdef WIN32 | ||
38 | + #define _SSIZE_T_DEFINED | ||
39 | + #endif | ||
40 | + #include <oorexxapi.h> | ||
41 | + #else | ||
42 | + #error Only Rexx 4 | ||
43 | + #endif | ||
44 | + | ||
34 | #include <errno.h> | 45 | #include <errno.h> |
35 | #include <stdio.h> | 46 | #include <stdio.h> |
36 | - #include <lib3270/config.h> | ||
37 | #include <lib3270.h> | 47 | #include <lib3270.h> |
38 | #include <lib3270/log.h> | 48 | #include <lib3270/log.h> |
39 | 49 | ||
40 | -#ifdef HAVE_OOREXXAPI_H | ||
41 | - #include <oorexxapi.h> | ||
42 | -#else | ||
43 | - #error Only Rexx 4 | ||
44 | -#endif | ||
45 | - | ||
46 | #ifndef ETIMEDOUT | 50 | #ifndef ETIMEDOUT |
47 | #define ETIMEDOUT -1 | 51 | #define ETIMEDOUT -1 |
48 | #endif // !ETIMEOUT | 52 | #endif // !ETIMEOUT |
@@ -95,7 +99,9 @@ | @@ -95,7 +99,9 @@ | ||
95 | /*--[ 3270 Session ]-----------------------------------------------------------------------------------------*/ | 99 | /*--[ 3270 Session ]-----------------------------------------------------------------------------------------*/ |
96 | 100 | ||
97 | #if defined (HAVE_GNUC_VISIBILITY) | 101 | #if defined (HAVE_GNUC_VISIBILITY) |
98 | - class __attribute__((visibility("default"))) rx3270 | 102 | + class __attribute__((visibility("default"))) rx3270 |
103 | +#elif defined(WIN32) | ||
104 | + class __declspec (dllexport) rx3270 | ||
99 | #else | 105 | #else |
100 | #error NOT_IMPLEMENTED | 106 | #error NOT_IMPLEMENTED |
101 | #endif | 107 | #endif |
src/plugins/rx3270/rxapimain.cc
@@ -52,8 +52,8 @@ | @@ -52,8 +52,8 @@ | ||
52 | 52 | ||
53 | /*--[ Globals ]--------------------------------------------------------------------------------------*/ | 53 | /*--[ Globals ]--------------------------------------------------------------------------------------*/ |
54 | 54 | ||
55 | - LIB3270_EXPORT RexxRoutineEntry rx3270_functions[]; | ||
56 | - LIB3270_EXPORT RexxPackageEntry rx3270_package_entry; | 55 | +// LIB3270_EXPORT RexxRoutineEntry rx3270_functions[]; |
56 | +// LIB3270_EXPORT RexxPackageEntry rx3270_package_entry; | ||
57 | 57 | ||
58 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 58 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
59 | 59 |
src/plugins/rx3270/text.cc
@@ -43,13 +43,13 @@ char * rx3270::get_3270_string(const char *str) | @@ -43,13 +43,13 @@ char * rx3270::get_3270_string(const char *str) | ||
43 | size_t out = (in << 1); | 43 | size_t out = (in << 1); |
44 | char *ptr; | 44 | char *ptr; |
45 | char *buffer = (char *) malloc(out); | 45 | char *buffer = (char *) malloc(out); |
46 | - char *ret; | 46 | + char *ret; |
47 | 47 | ||
48 | memset(ptr=buffer,0,out); | 48 | memset(ptr=buffer,0,out); |
49 | 49 | ||
50 | iconv(conv2Host,NULL,NULL,NULL,NULL); // Reset state | 50 | iconv(conv2Host,NULL,NULL,NULL,NULL); // Reset state |
51 | 51 | ||
52 | - if(iconv(conv2Host,(char **) &str,&in,&ptr,&out) == ((size_t) -1)) | 52 | + if(iconv(conv2Host,&str,&in,&ptr,&out) == ((size_t) -1)) |
53 | ret = strdup((char *) str); | 53 | ret = strdup((char *) str); |
54 | else | 54 | else |
55 | ret = strdup(buffer); | 55 | ret = strdup(buffer); |
@@ -78,7 +78,7 @@ char * rx3270::get_local_string(const char *str) | @@ -78,7 +78,7 @@ char * rx3270::get_local_string(const char *str) | ||
78 | 78 | ||
79 | iconv(conv2Local,NULL,NULL,NULL,NULL); // Reset state | 79 | iconv(conv2Local,NULL,NULL,NULL,NULL); // Reset state |
80 | 80 | ||
81 | - if(iconv(conv2Local,(char **) &str,&in,&ptr,&out) == ((size_t) -1)) | 81 | + if(iconv(conv2Local,&str,&in,&ptr,&out) == ((size_t) -1)) |
82 | ret = strdup((char *) str); | 82 | ret = strdup((char *) str); |
83 | else | 83 | else |
84 | ret = strdup(buffer); | 84 | ret = strdup(buffer); |
src/plugins/rx3270/typed_routines.cc
@@ -27,12 +27,10 @@ | @@ -27,12 +27,10 @@ | ||
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
30 | + #include "rx3270.h" | ||
30 | #include <time.h> | 31 | #include <time.h> |
31 | #include <string.h> | 32 | #include <string.h> |
32 | 33 | ||
33 | - #include "rx3270.h" | ||
34 | - | ||
35 | - | ||
36 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 34 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
37 | 35 | ||
38 | RexxRoutine0(CSTRING, rx3270version) | 36 | RexxRoutine0(CSTRING, rx3270version) |