Move ARRAY_LENGTH to compiler_compat.h

This commit is contained in:
Nick Mathewson 2018-06-22 08:41:57 -04:00
parent 0932f32291
commit 1e07b4031e
2 changed files with 3 additions and 2 deletions

View File

@ -451,6 +451,4 @@ STATIC int format_helper_exit_status(unsigned char child_state,
#endif /* defined(UTIL_PRIVATE) */ #endif /* defined(UTIL_PRIVATE) */
#define ARRAY_LENGTH(x) ((sizeof(x)) / sizeof(x[0]))
#endif /* !defined(TOR_UTIL_H) */ #endif /* !defined(TOR_UTIL_H) */

View File

@ -253,4 +253,7 @@
*/ */
#define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) ) #define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) )
/** Macro: Yields the number of elements in array x. */
#define ARRAY_LENGTH(x) ((sizeof(x)) / sizeof(x[0]))
#endif /* !defined(TOR_COMPAT_H) */ #endif /* !defined(TOR_COMPAT_H) */