[or-cvs] r17805: {tor} Use a consistent naming standard for header file guard macro (in tor/trunk: . src/common src/or)

nickm at seul.org nickm at seul.org
Mon Dec 29 02:21:02 UTC 2008


Author: nickm
Date: 2008-12-28 21:21:02 -0500 (Sun, 28 Dec 2008)
New Revision: 17805

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/common/address.h
   tor/trunk/src/common/aes.h
   tor/trunk/src/common/compat.h
   tor/trunk/src/common/container.h
   tor/trunk/src/common/crypto.h
   tor/trunk/src/common/ht.h
   tor/trunk/src/common/log.h
   tor/trunk/src/common/memarea.h
   tor/trunk/src/common/mempool.h
   tor/trunk/src/common/test.h
   tor/trunk/src/common/torgzip.h
   tor/trunk/src/common/torint.h
   tor/trunk/src/common/tortls.h
   tor/trunk/src/common/util.h
   tor/trunk/src/or/eventdns.h
   tor/trunk/src/or/or.h
Log:
Use a consistent naming standard for header file guard macros, taking care not to collide with any system headers.  This tripped us up on Android.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/ChangeLog	2008-12-29 02:21:02 UTC (rev 17805)
@@ -15,7 +15,12 @@
     - Make get_interface_address() function work properly again; stop
       guessing the wrong parts of our address as our address.
 
+  o Code simplifications and refactoring:
+    - Change our header file guard macros to be less likely to conflict
+      with system headers.  Adam Langley noticed that we were conflicting
+      with log.h on Android.
 
+
 Changes in version 0.2.1.9-alpha - 2008-12-25
   o New directory authorities:
     - gabelmoo (the authority run by Karsten Loesing) now has a new

Modified: tor/trunk/src/common/address.h
===================================================================
--- tor/trunk/src/common/address.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/address.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -9,8 +9,8 @@
  * \brief Headers for address.h
  **/
 
-#ifndef __ADDRESS_H
-#define __ADDRESS_H
+#ifndef _TOR_ADDRESS_H
+#define _TOR_ADDRESS_H
 #define ADDRESS_H_ID "$Id$"
 
 #include "orconfig.h"

Modified: tor/trunk/src/common/aes.h
===================================================================
--- tor/trunk/src/common/aes.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/aes.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -6,8 +6,8 @@
 
 /* Implements a minimal interface to counter-mode AES. */
 
-#ifndef __AES_H
-#define __AES_H
+#ifndef _TOR_AES_H
+#define _TOR_AES_H
 #define AES_H_ID "$Id$"
 
 /**

Modified: tor/trunk/src/common/compat.h
===================================================================
--- tor/trunk/src/common/compat.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/compat.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -4,8 +4,8 @@
 /* See LICENSE for licensing information */
 /* $Id$ */
 
-#ifndef __COMPAT_H
-#define __COMPAT_H
+#ifndef _TOR_COMPAT_H
+#define _TOR_COMPAT_H
 #define COMPAT_H_ID "$Id$"
 
 #include "orconfig.h"

Modified: tor/trunk/src/common/container.h
===================================================================
--- tor/trunk/src/common/container.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/container.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -4,8 +4,8 @@
 /* See LICENSE for licensing information */
 /* $Id$ */
 
-#ifndef __CONTAINER_H
-#define __CONTAINER_H
+#ifndef _TOR_CONTAINER_H
+#define _TOR_CONTAINER_H
 #define CONTAINER_H_ID \
   "$Id$"
 

Modified: tor/trunk/src/common/crypto.h
===================================================================
--- tor/trunk/src/common/crypto.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/crypto.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -11,8 +11,8 @@
  * \brief Headers for crypto.c
  **/
 
-#ifndef __CRYPTO_H
-#define __CRYPTO_H
+#ifndef _TOR_CRYPTO_H
+#define _TOR_CRYPTO_H
 #define CRYPTO_H_ID "$Id$"
 
 #include <stdio.h>

Modified: tor/trunk/src/common/ht.h
===================================================================
--- tor/trunk/src/common/ht.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/ht.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -5,8 +5,8 @@
 
 /* Based on ideas by Christopher Clark and interfaces from Niels Provos. */
 
-#ifndef __HT_H
-#define __HT_H
+#ifndef _TOR_HT_H
+#define _TOR_HT_H
 #define HT_H_ID "$Id$"
 
 #define HT_HEAD(name, type)                                             \

Modified: tor/trunk/src/common/log.h
===================================================================
--- tor/trunk/src/common/log.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/log.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -11,7 +11,7 @@
  * \brief Headers for log.c
  **/
 
-#ifndef __LOG_H
+#ifndef _TOR_LOG_H
 #define LOG_H_ID "$Id$"
 
 #include "compat.h"
@@ -205,6 +205,6 @@
 
 #endif /* !GNUC */
 
-# define __LOG_H
+# define _TOR_LOG_H
 #endif
 

Modified: tor/trunk/src/common/memarea.h
===================================================================
--- tor/trunk/src/common/memarea.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/memarea.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -3,8 +3,8 @@
 /* $Id$ */
 /* Tor dependencies */
 
-#ifndef MEMAREA_H
-#define MEMAREA_H
+#ifndef _TOR_MEMAREA_H
+#define _TOR_MEMAREA_H
 
 typedef struct memarea_t memarea_t;
 

Modified: tor/trunk/src/common/mempool.h
===================================================================
--- tor/trunk/src/common/mempool.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/mempool.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -7,8 +7,8 @@
  * \brief Headers for mempool.c
  **/
 
-#ifndef MEMPOOL_H
-#define MEMPOOL_H
+#ifndef _TOR_MEMPOOL_H
+#define _TOR_MEMPOOL_H
 
 /** A memory pool is a context in which a large number of fixed-sized
 * objects can be allocated efficiently.  See mempool.c for implementation

Modified: tor/trunk/src/common/test.h
===================================================================
--- tor/trunk/src/common/test.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/test.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -4,8 +4,8 @@
 /* See LICENSE for licensing information */
 /* $Id$ */
 
-#ifndef __TEST_H
-#define __TEST_H
+#ifndef _TOR_TEST_H
+#define _TOR_TEST_H
 #define TEST_H_ID "$Id$"
 
 /**

Modified: tor/trunk/src/common/torgzip.h
===================================================================
--- tor/trunk/src/common/torgzip.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/torgzip.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -9,8 +9,8 @@
  * \brief Headers for torgzip.h
  **/
 
-#ifndef __TORGZIP_H
-#define __TORGZIP_H
+#ifndef _TOR_TORGZIP_H
+#define _TOR_TORGZIP_H
 #define TORGZIP_H_ID "$Id$"
 
 /** Enumeration of what kind of compression to use.  Only ZLIB_METHOD is

Modified: tor/trunk/src/common/torint.h
===================================================================
--- tor/trunk/src/common/torint.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/torint.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -9,8 +9,8 @@
  * \brief Header file to define uint32_t and friends
  **/
 
-#ifndef __TORINT_H
-#define __TORINT_H
+#ifndef _TOR_TORINT_H
+#define _TOR_TORINT_H
 #define TORINT_H_ID "$Id$"
 
 #include "orconfig.h"

Modified: tor/trunk/src/common/tortls.h
===================================================================
--- tor/trunk/src/common/tortls.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/tortls.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -4,8 +4,8 @@
 /* See LICENSE for licensing information */
 /* $Id$ */
 
-#ifndef _TORTLS_H
-#define _TORTLS_H
+#ifndef _TOR_TORTLS_H
+#define _TOR_TORTLS_H
 #define TORTLS_H_ID "$Id$"
 
 /**

Modified: tor/trunk/src/common/util.h
===================================================================
--- tor/trunk/src/common/util.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/common/util.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -9,8 +9,8 @@
  * \brief Headers for util.c
  **/
 
-#ifndef __UTIL_H
-#define __UTIL_H
+#ifndef _TOR_UTIL_H
+#define _TOR_UTIL_H
 #define UTIL_H_ID "$Id$"
 
 #include "orconfig.h"

Modified: tor/trunk/src/or/eventdns.h
===================================================================
--- tor/trunk/src/or/eventdns.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/or/eventdns.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -209,8 +209,8 @@
  * with the next probe.
  */
 
-#ifndef EVENTDNS_H
-#define EVENTDNS_H
+#ifndef _TOR_EVENTDNS_H
+#define _TOR_EVENTDNS_H
 
 /* Error codes 0-5 are as described in RFC 1035. */
 #define DNS_ERR_NONE 0

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-12-29 02:20:57 UTC (rev 17804)
+++ tor/trunk/src/or/or.h	2008-12-29 02:21:02 UTC (rev 17805)
@@ -10,8 +10,8 @@
  * \brief Master header file for Tor-specific functionality.
  **/
 
-#ifndef __OR_H
-#define __OR_H
+#ifndef _TOR_OR_H
+#define _TOR_OR_H
 #define OR_H_ID "$Id$"
 
 #include "orconfig.h"



More information about the tor-commits mailing list