[or-cvs] r12088: Check a platform assumption we have made without checking fo (in tor/trunk: . src/common)

nickm at seul.org nickm at seul.org
Mon Oct 22 00:44:42 UTC 2007


Author: nickm
Date: 2007-10-21 20:44:42 -0400 (Sun, 21 Oct 2007)
New Revision: 12088

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/common/compat.h
Log:
 r16016 at catbus:  nickm | 2007-10-21 20:44:19 -0400
 Check a platform assumption we have made without checking for too long: "Characters are represented in ascii."



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16016] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-10-22 00:29:39 UTC (rev 12087)
+++ tor/trunk/ChangeLog	2007-10-22 00:44:42 UTC (rev 12088)
@@ -46,6 +46,10 @@
     - Don't try to launch descriptor downloads quite so often when we
       have enough directory information.
 
+  o Minor features (compilation):
+    - Detect non-ASCII platforms (if any still exist) and refuse to
+      build there.  Some of our code assumes that 'A' is 65 and so on.
+
   o Minor bugfixes (directory authorities):
     - Correct the implementation of "download votes by digest."  Bugfix on
       0.2.0.8-alpha.

Modified: tor/trunk/src/common/compat.h
===================================================================
--- tor/trunk/src/common/compat.h	2007-10-22 00:29:39 UTC (rev 12087)
+++ tor/trunk/src/common/compat.h	2007-10-22 00:44:42 UTC (rev 12088)
@@ -50,6 +50,10 @@
 #error "It seems your platform does not represent NULL as zero. We can't cope."
 #endif
 
+#if 'a'!=97 || 'z'!=122 || 'A'!=65 || ' '!=32
+#error "It seems that you encode characters in something other than ASCII."
+#endif
+
 /* ===== Compiler compatibility */
 
 /* GCC can check printf types on arbitrary functions. */



More information about the tor-commits mailing list