You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2006/10/24 18:21:10 UTC

svn commit: r467372 - in /lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules: Integers.charm Integers.harm

Author: marvin
Date: Tue Oct 24 09:21:10 2006
New Revision: 467372

URL: http://svn.apache.org/viewvc?view=rev&rev=467372
Log:
Add HAS_I8_T etc. to Integers module.

Modified:
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.harm

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm?view=diff&rev=467372&r1=467371&r2=467372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm Tue Oct 24 09:21:10 2006
@@ -137,25 +137,29 @@
     if (sizeof_char == 1) {
         has_8 = true;
         append_conf(conf_fh,
+            "#define %sHAS_I8_T\n"
             "typedef char %si8_t;\n"
             "typedef unsigned char %su8_t;\n",
-            typedef_prefix, typedef_prefix
+            constant_prefix, typedef_prefix, typedef_prefix
         );
     }
     if (sizeof_short == 2) {
         has_16 = true;
         append_conf(conf_fh,
+            "#define %sHAS_I16_T\n"
             "typedef short %si16_t;\n"
             "typedef unsigned short %su16_t;\n",
-            typedef_prefix, typedef_prefix
+            constant_prefix, typedef_prefix, typedef_prefix
         );
     }
     if (sizeof_int == 4 || sizeof_long == 4) {
         char *type = sizeof_int == 4 ? "int" : "long";
         has_32 = true;
         append_conf(conf_fh,
+            "#define %sHAS_I32_T\n"
             "typedef %s %si32_t;\n"
             "typedef unsigned %s %su32_t;\n",
+            constant_prefix,
             type, typedef_prefix, 
             type, typedef_prefix
         );
@@ -192,8 +196,10 @@
         /* we have 64-bit ints, so add the typedef */
         has_64 = true;
         append_conf(conf_fh,
+            "#define %sHAS_I64_T\n"
             "typedef %s %si64_t;\n"
             "typedef unsigned %s %su64_t;\n",
+            constant_prefix,
             type, typedef_prefix, 
             type, typedef_prefix
         );
@@ -252,19 +258,23 @@
         shorten_typedef(conf_fh, "bool_t");
 
         if (has_8) {
+            shorten_constant(conf_fh, "HAS_I8_T");
             shorten_typedef(conf_fh, "i8_t");
             shorten_typedef(conf_fh, "u8_t");
         }
         if (has_16) {
+            shorten_constant(conf_fh, "HAS_I16_T");
             shorten_typedef(conf_fh, "i16_t");
             shorten_typedef(conf_fh, "u16_t");
         }
         if (has_32) {
+            shorten_constant(conf_fh, "HAS_I32_T");
             shorten_typedef(conf_fh, "i32_t");
             shorten_typedef(conf_fh, "u32_t");
         }
 
         if (has_64) {
+            shorten_constant(conf_fh, "HAS_I64_T");
             shorten_typedef(conf_fh, "i64_t");
             shorten_typedef(conf_fh, "u64_t");
             shorten_macro(conf_fh, "I64P");

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.harm?view=diff&rev=467372&r1=467371&r2=467372
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.harm Tue Oct 24 09:21:10 2006
@@ -36,6 +36,14 @@
  * u32_t
  * i64_t
  * u64_t
+ * 
+ * Availability of the preceding integer typedefs is indicated by which of
+ * these are defined:
+ * 
+ * HAS_I8_T
+ * HAS_I16_T
+ * HAS_I32_T
+ * HAS_I64_T
  *
  * If 64-bit integers type are available, these macros will expand to the
  * printf conversion specification for signed and unsigned versions (most