OSDN Git Service

android/client: Add NELEM macro for count elements
authorJerzy Kasenberg <jerzy.kasenberg@tieto.com>
Fri, 8 Nov 2013 12:48:24 +0000 (13:48 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 8 Nov 2013 13:12:57 +0000 (15:12 +0200)
NELEM macro will be used in several places.

android/client/if-main.h

index 647162c..dea7237 100644 (file)
@@ -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, ...) \
        { \