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 | 43 | #include <stdarg.h> |
44 | 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 | 55 | /*--[ Class definition ]-----------------------------------------------------------------------------*/ |
48 | 56 | |
... | ... | @@ -96,7 +104,7 @@ |
96 | 104 | void (*_set_toggle)(H3270 *h, LIB3270_TOGGLE ix, int value); |
97 | 105 | |
98 | 106 | #ifdef WIN32 |
99 | - HMODULE hModule | |
107 | + HMODULE hModule; | |
100 | 108 | #else |
101 | 109 | void * hModule; |
102 | 110 | #endif // WIN32 |
... | ... | @@ -376,7 +384,7 @@ dynamic::dynamic() |
376 | 384 | fflush(stderr); |
377 | 385 | dlclose(hModule); |
378 | 386 | #else |
379 | - #error DLL close | |
387 | + FreeLibrary(hModule); | |
380 | 388 | #endif // !WIN32 |
381 | 389 | hModule = NULL; |
382 | 390 | return; | ... | ... |
src/plugins/rx3270/pluginmain.cc
... | ... | @@ -27,9 +27,9 @@ |
27 | 27 | * |
28 | 28 | */ |
29 | 29 | |
30 | + #include "rx3270.h" | |
30 | 31 | #include <pw3270/plugin.h> |
31 | 32 | #include <lib3270/actions.h> |
32 | - #include "rx3270.h" | |
33 | 33 | |
34 | 34 | /*--[ Plugin session object ]--------------------------------------------------------------------------------*/ |
35 | 35 | ... | ... |
src/plugins/rx3270/rexx_methods.cc
... | ... | @@ -27,12 +27,10 @@ |
27 | 27 | * |
28 | 28 | */ |
29 | 29 | |
30 | + #include "rx3270.h" | |
30 | 31 | #include <time.h> |
31 | 32 | #include <string.h> |
32 | 33 | |
33 | - #include "rx3270.h" | |
34 | - | |
35 | - | |
36 | 34 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
37 | 35 | |
38 | 36 | RexxMethod1(int, rx3270_method_init, CSTRING, type) | ... | ... |
src/plugins/rx3270/rx3270.h
... | ... | @@ -31,18 +31,22 @@ |
31 | 31 | |
32 | 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 | 45 | #include <errno.h> |
35 | 46 | #include <stdio.h> |
36 | - #include <lib3270/config.h> | |
37 | 47 | #include <lib3270.h> |
38 | 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 | 50 | #ifndef ETIMEDOUT |
47 | 51 | #define ETIMEDOUT -1 |
48 | 52 | #endif // !ETIMEOUT |
... | ... | @@ -95,7 +99,9 @@ |
95 | 99 | /*--[ 3270 Session ]-----------------------------------------------------------------------------------------*/ |
96 | 100 | |
97 | 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 | 105 | #else |
100 | 106 | #error NOT_IMPLEMENTED |
101 | 107 | #endif | ... | ... |
src/plugins/rx3270/rxapimain.cc
... | ... | @@ -52,8 +52,8 @@ |
52 | 52 | |
53 | 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 | 58 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
59 | 59 | ... | ... |
src/plugins/rx3270/text.cc
... | ... | @@ -43,13 +43,13 @@ char * rx3270::get_3270_string(const char *str) |
43 | 43 | size_t out = (in << 1); |
44 | 44 | char *ptr; |
45 | 45 | char *buffer = (char *) malloc(out); |
46 | - char *ret; | |
46 | + char *ret; | |
47 | 47 | |
48 | 48 | memset(ptr=buffer,0,out); |
49 | 49 | |
50 | 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 | 53 | ret = strdup((char *) str); |
54 | 54 | else |
55 | 55 | ret = strdup(buffer); |
... | ... | @@ -78,7 +78,7 @@ char * rx3270::get_local_string(const char *str) |
78 | 78 | |
79 | 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 | 82 | ret = strdup((char *) str); |
83 | 83 | else |
84 | 84 | ret = strdup(buffer); | ... | ... |
src/plugins/rx3270/typed_routines.cc
... | ... | @@ -27,12 +27,10 @@ |
27 | 27 | * |
28 | 28 | */ |
29 | 29 | |
30 | + #include "rx3270.h" | |
30 | 31 | #include <time.h> |
31 | 32 | #include <string.h> |
32 | 33 | |
33 | - #include "rx3270.h" | |
34 | - | |
35 | - | |
36 | 34 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
37 | 35 | |
38 | 36 | RexxRoutine0(CSTRING, rx3270version) | ... | ... |