From: Jerzy Kasenberg Date: Fri, 8 Nov 2013 12:48:24 +0000 (+0100) Subject: android/client: Add NELEM macro for count elements X-Git-Tag: android-x86-4.4-r3~6910 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=464d9b64afeb5cfc4cd9fefc53d346702fe13344;p=android-x86%2Fexternal-bluetooth-bluez.git android/client: Add NELEM macro for count elements NELEM macro will be used in several places. --- diff --git a/android/client/if-main.h b/android/client/if-main.h index 647162c6b..dea723766 100644 --- a/android/client/if-main.h +++ b/android/client/if-main.h @@ -144,6 +144,8 @@ struct method *get_command(const char *name); const struct method *get_interface_method(const char *iname, const char *mname); +#define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) + /* Helper macro for executing function on interface and printing BT_STATUS */ #define EXEC(f, ...) \ { \