move ec_count_of in utils.h
authorOlivier Matz <zer0@droids-corp.org>
Sun, 23 Feb 2020 22:37:07 +0000 (23:37 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 23 Feb 2020 22:37:07 +0000 (23:37 +0100)
include/ecoli_config.h
include/ecoli_strvec.h
include/ecoli_utils.h

index ba93337..8ae15ed 100644 (file)
 #include <stdint.h>
 #include <stdio.h>
 
-#ifndef EC_COUNT_OF //XXX
-#define EC_COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / \
-               ((size_t)(!(sizeof(x) % sizeof(0[x])))))
-#endif
-
 struct ec_config;
 struct ec_dict;
 
index 2464a2b..ee793e7 100644 (file)
  */
 struct ec_strvec *ec_strvec(void);
 
-#ifndef EC_COUNT_OF
-#define EC_COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / \
-               ((size_t)(!(sizeof(x) % sizeof(0[x])))))
-#endif
-
 /**
  * Allocate a new string vector
  *
index 7b76c17..7d6afcb 100644 (file)
  */
 #define EC_VA_END ((void *)1)
 
+/**
+ * Count number of elements in an array.
+ */
+#define EC_COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / \
+               ((size_t)(!(sizeof(x) % sizeof(0[x])))))
+
 #endif
 
 /** @} */