X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=irmp%2Firmp-main-sharedlib.c;h=6f5c0581ccef56d12829689d73f9cff2a3ea6f9e;hb=8c3291c74998bddac4b355d2ffbaf94e22bad3a7;hp=baa65c98c83a56998a956a42dcd3769175a91283;hpb=19a0121b2c45d880dab2362d59e1426a5b287a26;p=libsigrokdecode.git diff --git a/irmp/irmp-main-sharedlib.c b/irmp/irmp-main-sharedlib.c index baa65c9..6f5c058 100644 --- a/irmp/irmp-main-sharedlib.c +++ b/irmp/irmp-main-sharedlib.c @@ -23,7 +23,18 @@ * Include the IRMP core logic. This approach is required because of * static variables which hold internal state. The core logic started * as an MCU project where resources are severely constrained. + * + * This libsigrokdecode incarnation of IRMP will always be used in the + * UNIX_OR_WINDOWS configuration. But libtool(1) breaks the upstream + * logic's platform detection. Check reliably available conditions here + * and provide expected symbols to the library, to reduce changes to the + * upstream project. */ +#if defined _WIN32 +# define WIN32 +#else +# define unix +#endif #include "irmp.h" #include "irmp.c" @@ -111,6 +122,19 @@ IRMP_DLLEXPORT void irmp_reset_state(void) s_startBitSample = 0; s_curSample = 0; s_end_sample = 0; + + /* + * TODO This is not the most appropriate location to control the + * core logic's verbosity. But out of the public set of library + * routines this call is closest to some initialization routine. + * The query for compile time parameter values is optional, the + * state reset is not. Multiple verbosity setup activities in + * the same program lifetime won't harm. This HACK is clearly + * preferrable over more fiddling with core logic innards, or + * the introduction of yet another DLL routine. + */ + silent = 1; + verbose = 0; } IRMP_DLLEXPORT int irmp_add_one_sample(int sample)