From 5a2adb2142f23da85cbed411711bfc155fd2f486 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sat, 8 Jul 2023 11:19:33 -0300 Subject: [PATCH] Reverting use of inner functions; doesnt work on macos compiler. --- .github/workflows/macos.yml | 21 +++++++++++++++++++++ src/core/properties/signed.c | 28 ++++++++++++---------------- src/core/properties/string.c | 20 +++++++++----------- src/core/properties/unsigned.c | 10 ++++------ 4 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..ca0764c --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,21 @@ +name: MacOS Test +on: + push: + branches: + - macos +jobs: + build: + name: Build for macos + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Pre reqs + run: | + brew update + brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig + brew upgrade + - name: build + run: ./mac/ci-build.sh + + diff --git a/src/core/properties/signed.c b/src/core/properties/signed.c index c560c92..fdfbbdd 100644 --- a/src/core/properties/signed.c +++ b/src/core/properties/signed.c @@ -108,11 +108,19 @@ LIB3270_EXPORT const char * lib3270_get_ssl_state_as_string(const H3270 * hSessi return _( "Unknown" ); } -const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void) { +static int lib3270_get_connection_state_as_int(const H3270 *hSession) { + return (int) lib3270_get_connection_state(hSession); +} + +static int lib3270_get_ssl_state_as_int(const H3270 * hSession) { + return (int) lib3270_get_ssl_state(hSession); +} - auto int lib3270_get_connection_state_as_int(const H3270 *hSession); - auto int lib3270_get_ssl_state_as_int(const H3270 * hSession); - auto int lib3270_get_program_message_as_int(const H3270 *hSession); +static int lib3270_get_program_message_as_int(const H3270 *hSession) { + return (int) lib3270_get_program_message(hSession); +} + +const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void) { static const LIB3270_INT_PROPERTY properties[] = { @@ -158,18 +166,6 @@ const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void) { } }; - int lib3270_get_connection_state_as_int(const H3270 *hSession) { - return (int) lib3270_get_connection_state(hSession); - } - - int lib3270_get_ssl_state_as_int(const H3270 * hSession) { - return (int) lib3270_get_ssl_state(hSession); - } - - int lib3270_get_program_message_as_int(const H3270 *hSession) { - return (int) lib3270_get_program_message(hSession); - } - return properties; } diff --git a/src/core/properties/string.c b/src/core/properties/string.c index ce27c05..a2115d9 100644 --- a/src/core/properties/string.c +++ b/src/core/properties/string.c @@ -44,10 +44,16 @@ LIB3270_EXPORT const char * lib3270_get_termname(const H3270 *hSession) { return hSession->termname; } -LIB3270_EXPORT const LIB3270_STRING_PROPERTY * lib3270_get_string_properties_list(void) { +static const char * get_version(const H3270 GNUC_UNUSED(*hSession)) { + return lib3270_get_version(); +} + +static const char * get_revision(const H3270 GNUC_UNUSED(*hSession)) { + return lib3270_get_revision(); +} + - auto const char * get_version(const H3270 GNUC_UNUSED(*hSession)); - auto const char * get_revision(const H3270 GNUC_UNUSED(*hSession)); +LIB3270_EXPORT const LIB3270_STRING_PROPERTY * lib3270_get_string_properties_list(void) { static const LIB3270_STRING_PROPERTY properties[] = { @@ -192,14 +198,6 @@ LIB3270_EXPORT const LIB3270_STRING_PROPERTY * lib3270_get_string_properties_lis }; - const char * get_version(const H3270 GNUC_UNUSED(*hSession)) { - return lib3270_get_version(); - } - - const char * get_revision(const H3270 GNUC_UNUSED(*hSession)) { - return lib3270_get_revision(); - } - return properties; } diff --git a/src/core/properties/unsigned.c b/src/core/properties/unsigned.c index d9c57eb..498bf16 100644 --- a/src/core/properties/unsigned.c +++ b/src/core/properties/unsigned.c @@ -64,9 +64,11 @@ LIB3270_EXPORT int lib3270_set_auto_reconnect(H3270 *hSession, unsigned int time return 0; } -const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) { +static unsigned int lib3270_get_kybdlock_as_int(const H3270 *hSession) { + return (unsigned int) lib3270_get_keyboard_lock_state(hSession); +} - auto unsigned int lib3270_get_kybdlock_as_int(const H3270 *hSession); +const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) { static const LIB3270_UINT_PROPERTY properties[] = { @@ -175,10 +177,6 @@ const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) { } }; - unsigned int lib3270_get_kybdlock_as_int(const H3270 *hSession) { - return (unsigned int) lib3270_get_keyboard_lock_state(hSession); - } - return properties; } -- libgit2 0.21.2