From: Uwe Hermann Date: Sun, 20 Feb 2011 17:29:05 +0000 (+0100) Subject: Make ARRAY_SIZE/ARRAY_AND_SIZE private. X-Git-Tag: libsigrok-0.1.0~315 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=4cea9eb20dc8d816a67c57d111a3a4529d452e4d Make ARRAY_SIZE/ARRAY_AND_SIZE private. This is not libsigrok-specific and should not be part of our API. --- diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 55742811..8651e779 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "analyzer.h" #define USB_VENDOR 0x0c12 diff --git a/sigrok-internal.h b/sigrok-internal.h index 85004aa1..a5326d2b 100644 --- a/sigrok-internal.h +++ b/sigrok-internal.h @@ -20,6 +20,16 @@ #ifndef SIGROK_SIGROK_INTERNAL_H #define SIGROK_SIGROK_INTERNAL_H +/*--- Macros ----------------------------------------------------------------*/ + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +#endif + +#ifndef ARRAY_AND_SIZE +#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a) +#endif + /*--- hwplugin.c ------------------------------------------------------------*/ int load_hwplugins(void); diff --git a/sigrok.h b/sigrok.h index ba571c2c..6eeca9a3 100644 --- a/sigrok.h +++ b/sigrok.h @@ -66,14 +66,6 @@ extern "C" { #define HZ_TO_NS(n) (1000000000 / (n)) -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#endif - -#ifndef ARRAY_AND_SIZE -#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a) -#endif - typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data); /* Data types used by hardware plugins for set_configuration() */