[uim-commit] r2752 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Tue Jan 3 02:12:51 PST 2006


Author: yamaken
Date: 2006-01-03 02:12:46 -0800 (Tue, 03 Jan 2006)
New Revision: 2752

Modified:
   branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/sigscheme.h
  - (scm_bool): New type
  - (scm_false, scm_true): New macro


Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h	2006-01-03 09:01:46 UTC (rev 2751)
+++ branches/r5rs/sigscheme/sigscheme.h	2006-01-03 10:12:46 UTC (rev 2752)
@@ -188,6 +188,28 @@
 /*============================================================================
   Type Definitions
 ============================================================================*/
+
+/*
+ * SigScheme's own Boolean type:
+ *
+ * libsscm does not use C99 stdbool, its autoconf equivalent or popular
+ * combination of {int, TRUE, FALSE}, to avoid system-dependent ABI
+ * incompatibility (such as size difference) and client-dependent problem (such
+ * as an unexpected assumption about TRUE value).
+ *
+ * The definition use plain typedef and macro definition to avoid
+ * misrecognition about the usage of the type, such as enum-related ones.
+ *
+ *                           *** IMPORTANT ***
+ *
+ * Do not test a value with (val == scm_true). The scm_true is only A TYPICAL
+ * VALUE FOR TRUE. Use (val) or (val != scm_false) instead.
+ *
+ */
+typedef int scm_bool;
+#define scm_false 0
+#define scm_true  (!scm_false)
+
 enum ScmDebugCategory {
     SCM_DBG_NONE         = 0,
     SCM_DBG_ERRMSG       = 1 << 0,   /* the "Error: foo bar" style msgs */



More information about the uim-commit mailing list