diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-22 08:41:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-22 09:49:13 -0400 |
commit | 1e07b4031e2613826cf7ff2838a2f0c8f03e81c2 (patch) | |
tree | 8575c7015ba9991055c3e0ed14542ff5bdd57173 /src/lib/cc/compat_compiler.h | |
parent | 0932f322911f41e72b5155d06775658039814a39 (diff) | |
download | tor-1e07b4031e2613826cf7ff2838a2f0c8f03e81c2.tar.gz tor-1e07b4031e2613826cf7ff2838a2f0c8f03e81c2.zip |
Move ARRAY_LENGTH to compiler_compat.h
Diffstat (limited to 'src/lib/cc/compat_compiler.h')
-rw-r--r-- | src/lib/cc/compat_compiler.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h index 763c3d06d5..67d945cfaf 100644 --- a/src/lib/cc/compat_compiler.h +++ b/src/lib/cc/compat_compiler.h @@ -253,4 +253,7 @@ */ #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) */ |