From: Jonathan Aillet Date: Tue, 10 Jul 2018 08:29:11 +0000 (+0200) Subject: Use binding version to handle dynapi X-Git-Tag: flounder/5.99.2~5 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=fc1c62a3a68bc95404c2d2a3ae72318ed6873b98;p=apps%2Fapp-afb-helpers-submodule.git Use binding version to handle dynapi Use binding version to define dynamic api debug messages function. It is also cleaner to define binding version directly into repository cmake than into a header like before this commit. Change-Id: Ia14f635a7a2cec05c29f27ee4ce645711a8574a4 Signed-off-by: Jonathan Aillet --- diff --git a/filescan-utils.c b/filescan-utils.c index a6111c1..6b3cf65 100644 --- a/filescan-utils.c +++ b/filescan-utils.c @@ -152,7 +152,7 @@ char* GetBindingDirPath(struct afb_dynapi* dynapi) char retdir[CONTROL_MAXPATH_LEN]; ssize_t len; -#ifdef USE_API_DYN +#if((AFB_BINDING_VERSION == 0 || AFB_BINDING_VERSION == 3) && defined(AFB_BINDING_WANT_DYNAPI)) if (!dynapi) return NULL; sprintf(fd_link, "/proc/self/fd/%d", afb_dynapi_rootdir_get_fd(dynapi)); diff --git a/filescan-utils.h b/filescan-utils.h index 906d92c..3e1dba6 100644 --- a/filescan-utils.h +++ b/filescan-utils.h @@ -26,16 +26,11 @@ extern "C" { #endif -// hack waiting for official V3 API -#ifdef USE_API_DYN - #define AFB_BINDING_VERSION 0 - #define AFB_BINDING_WANT_DYNAPI - #include +#include + +#if((AFB_BINDING_VERSION == 0 || AFB_BINDING_VERSION == 3) && defined(AFB_BINDING_WANT_DYNAPI)) extern afb_dynapi *AFB_default; #define AFB_DEBUG(...) AFB_DYNAPI_DEBUG(AFB_default, __VA_ARGS__) -#else - #define AFB_BINDING_VERSION 2 - #include #endif #include