]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Move STRUCT_VAR_P to compat_compiler.
authorNick Mathewson <nickm@torproject.org>
Thu, 21 Jun 2018 20:29:24 +0000 (16:29 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 22 Jun 2018 13:49:13 +0000 (09:49 -0400)
src/common/util.h
src/lib/cc/compat_compiler.h
src/lib/container/smartlist.c

index 1c889082b99f182bced3b354a249ce5a008862ed..916bddc1fef43d8a4718d2da2ffe8ccb7399682a 100644 (file)
@@ -41,17 +41,6 @@ uint64_t tor_ntohll(uint64_t a);
 
 void tor_log_mallinfo(int severity);
 
-/** Macro: yield a pointer to the field at position <b>off</b> within the
- * structure <b>st</b>.  Example:
- * <pre>
- *   struct a { int foo; int bar; } x;
- *   off_t bar_offset = offsetof(struct a, bar);
- *   int *bar_p = STRUCT_VAR_P(&x, bar_offset);
- *   *bar_p = 3;
- * </pre>
- */
-#define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) )
-
 /** Macro: yield a pointer to an enclosing structure given a pointer to
  * a substructure at offset <b>off</b>. Example:
  * <pre>
index 31e84bcc5b6f41655fdd484899edb60d5fb56292..763c3d06d53372bf9058b9fb5e3a88f69a3ca95d 100644 (file)
 #error Unknown: SIZEOF_INTPTR_T
 #endif /* (SIZEOF_INTPTR_T == SIZEOF_INT) || ... */
 
+/** Macro: yield a pointer to the field at position <b>off</b> within the
+ * structure <b>st</b>.  Example:
+ * <pre>
+ *   struct a { int foo; int bar; } x;
+ *   off_t bar_offset = offsetof(struct a, bar);
+ *   int *bar_p = STRUCT_VAR_P(&x, bar_offset);
+ *   *bar_p = 3;
+ * </pre>
+ */
+#define STRUCT_VAR_P(st, off) ((void*) ( ((char*)(st)) + (off) ) )
+
 #endif /* !defined(TOR_COMPAT_H) */
index 6aef728547dfd0c2d22f2eed1e913e6781831eb6..0fe11c6703bf271268494933bd5518174396d7d5 100644 (file)
@@ -13,7 +13,8 @@
 
 #include "lib/malloc/util_malloc.h"
 #include "lib/container/smartlist.h"
-#include "common/util.h"
+#include "lib/err/torerr.h"
+#include "common/util.h" // For strstrip.
 #include "lib/crypt_ops/crypto_digest.h"
 #include "lib/ctime/di_ops.h"