2006-02-01 Ludovic Courtès <ludovic.courtes@laas.fr>
[bpt/guile.git] / libguile / gen-scmconfig.c
index 481b4ee..d162e39 100644 (file)
@@ -226,6 +226,12 @@ main (int argc, char *argv[])
     pf ("#define GUILE_DEBUG_FREELIST 1 /* defined or undefined */\n");
   else
     pf ("/* #undef GUILE_DEBUG_FREELIST */\n");
+
+  /*** SCM_ENABLE_DISCOURAGED (0 or 1) ***/
+  pf ("\n");
+  pf ("/* Set to 1 if you want to enable discouraged features. */\n");
+  pf ("/* (value will be 0 or 1). */\n");
+  pf ("#define SCM_ENABLE_DISCOURAGED %d\n", SCM_I_GSC_ENABLE_DISCOURAGED);
   
   /*** SCM_ENABLE_DEPRECATED (0 or 1) ***/
   pf ("\n");
@@ -238,11 +244,6 @@ main (int argc, char *argv[])
   pf ("/* Set to 1 to add Elisp support (in addition to Scheme). */\n");
   pf ("#define SCM_ENABLE_ELISP %d /* 0 or 1 */\n", SCM_I_GSC_ENABLE_ELISP);
 
-  /*** SCM_HAVE_ARRAYS (0 or 1) ***/
-  pf ("\n");
-  pf ("/* Set to 1 to add support for arrays and uniform arrays. */\n");
-  pf ("#define SCM_HAVE_ARRAYS %d /* 0 or 1 */\n", SCM_I_GSC_HAVE_ARRAYS);
-
   /*** SCM_STACK_GROWS_UP (0 or 1) ***/
   pf ("\n");
   pf ("/* Set to 1 if the stack grows up, 0 otherwise. */\n");
@@ -270,6 +271,7 @@ main (int argc, char *argv[])
   pf ("#define SCM_SIZEOF_UNSIGNED_LONG %d\n", SIZEOF_UNSIGNED_LONG);
   pf ("#define SCM_SIZEOF_INT %d\n", SIZEOF_INT);
   pf ("#define SCM_SIZEOF_UNSIGNED_INT %d\n", SIZEOF_UNSIGNED_INT);
+  pf ("#define SCM_SIZEOF_SIZE_T %d\n", SIZEOF_SIZE_T);
 
   pf ("\n");
   pf ("/* Size of (unsigned) long long or 0 if not available (scm_t_*64 may\n"
@@ -300,6 +302,17 @@ main (int argc, char *argv[])
   pf ("typedef %s scm_t_uint16;\n", SCM_I_GSC_T_UINT16);
   pf ("typedef %s scm_t_int32;\n", SCM_I_GSC_T_INT32);
   pf ("typedef %s scm_t_uint32;\n", SCM_I_GSC_T_UINT32);
+  pf ("typedef %s scm_t_intmax;\n", SCM_I_GSC_T_INTMAX);
+  pf ("typedef %s scm_t_uintmax;\n", SCM_I_GSC_T_UINTMAX);
+
+  if (0 == strcmp ("intmax_t", SCM_I_GSC_T_INTMAX))
+    pf ("#define SCM_SIZEOF_INTMAX %d\n", SIZEOF_INTMAX_T);
+  else if (0 == strcmp ("long long", SCM_I_GSC_T_INTMAX))
+    pf ("#define SCM_SIZEOF_INTMAX %d\n", SIZEOF_LONG_LONG);
+  else if (0 == strcmp ("__int64", SCM_I_GSC_T_INTMAX))
+    pf ("#define SCM_SIZEOF_INTMAX %d\n", SIZEOF___INT64);
+  else
+    return 1;
 
   pf ("\n");
   pf ("/* 64-bit integer -- if available SCM_HAVE_T_INT64 will be 1 and\n"
@@ -365,10 +378,6 @@ main (int argc, char *argv[])
   pf ("#define SCM_USE_NULL_THREADS %d /* 0 or 1 */\n",
       SCM_I_GSC_USE_NULL_THREADS);
 
-  pf ("/* FIXME: what is this used for now? */\n");
-  pf ("#define SCM_USE_COOP_THREADS %d /* 0 or 1 */\n",
-      SCM_I_GSC_USE_COOP_THREADS);
-
 #if USE_DLL_IMPORT
   pf ("\n");
   pf ("/* Define some additional CPP macros on Win32 platforms. */\n");
@@ -388,6 +397,8 @@ main (int argc, char *argv[])
       "#endif\n");
   printf ("\n");
 
+  pf ("#define SCM_HAVE_ARRAYS 1 /* always true now */\n");
+
   printf ("#endif\n");
 
   return 0;