lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/42707?usp=email )
Change subject: asn1: move asn_debug into librspro ......................................................................
asn1: move asn_debug into librspro
To allow compiling the asn code with `-DEMIT_ASN_DEBUG=1`. Otherwise it will fail with an unresolved symbol because librspro is compiled as shared-object. Further initialize it as disable (0).
Change-Id: Icb03e8905f3b38ecebfcf294727a01f994511cce --- M src/asn1c_helpers.c M src/asn1c_helpers.h M src/bankd/bankd_main.c M src/bankd/main.c M src/client/remsim_client_main.c 5 files changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/07/42707/1
diff --git a/src/asn1c_helpers.c b/src/asn1c_helpers.c index ea3f5a6..5a2416a 100644 --- a/src/asn1c_helpers.c +++ b/src/asn1c_helpers.c @@ -7,6 +7,8 @@
#include "asn1c_helpers.h"
+int asn_debug = 0; + const char *asn_type_name(const asn_TYPE_descriptor_t *td) { return td->name; diff --git a/src/asn1c_helpers.h b/src/asn1c_helpers.h index ac34a8f..75a68d7 100644 --- a/src/asn1c_helpers.h +++ b/src/asn1c_helpers.h @@ -1,6 +1,9 @@ #pragma once
#include <asn_application.h> + +extern int asn_debug; + struct asn_TYPE_descriptor_t;
const char *asn_type_name(const asn_TYPE_descriptor_t *td); diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c index 5e33b41..ae3ed26 100644 --- a/src/bankd/bankd_main.c +++ b/src/bankd/bankd_main.c @@ -44,6 +44,7 @@ #include <asn_application.h> #include <osmocom/rspro/RsproPDU.h>
+#include "asn1c_helpers.h" #include "bankd.h" #include "rspro_client_fsm.h" #include "debug.h" @@ -69,8 +70,6 @@ * bankd core / main thread ***********************************************************************/
-int asn_debug; - static void bankd_init(struct bankd *bankd) { g_tall_ctx = talloc_named_const(NULL, 0, "global"); diff --git a/src/bankd/main.c b/src/bankd/main.c index f4601ae..54aac61 100644 --- a/src/bankd/main.c +++ b/src/bankd/main.c @@ -30,10 +30,10 @@ #include <winscard.h>
#include "internal.h" +#include "asn1c_helpers.h"
static void *g_ctx; __thread void *talloc_asn1_ctx; -int asn_debug;
int main(int argc, char **argv) { diff --git a/src/client/remsim_client_main.c b/src/client/remsim_client_main.c index 2f9b8e0..a2f7cd1 100644 --- a/src/client/remsim_client_main.c +++ b/src/client/remsim_client_main.c @@ -14,7 +14,6 @@
static void *g_tall_ctx; void __thread *talloc_asn1_ctx; -int asn_debug;
static void handle_sig_usr1(int signal) {