* gen-scmconfig.h.in (SCM_I_GSC_HAVE_ARRAYS): Removed.
[bpt/guile.git] / libguile / inline.h
index 3938652..703e1c6 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef SCM_INLINE_H
 #define SCM_INLINE_H
 
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -53,7 +53,12 @@ extern unsigned scm_newcell_count;
 
 #if defined SCM_C_INLINE && ! defined SCM_INLINE_C_INCLUDING_INLINE_H
 /* definitely inlining */
-extern SCM_C_INLINE
+#ifdef __GNUC__
+extern
+#else
+static
+#endif
+SCM_C_INLINE
 #endif
 SCM
 scm_cell (scm_t_bits car, scm_t_bits cdr)
@@ -61,7 +66,7 @@ scm_cell (scm_t_bits car, scm_t_bits cdr)
   SCM z;
   /* We retrieve the SCM pointer only once since the call to
      SCM_FREELIST_LOC will be slightly expensive when we support
-     preemptive multithreading.  SCM_FREELIST_DOC will then retrieve
+     preemptive multithreading.  SCM_FREELIST_LOC will then retrieve
      the thread specific freelist.
    
      Until then, SCM_FREELIST_DOC expands to (&scm_i_freelist) and the
@@ -70,7 +75,12 @@ scm_cell (scm_t_bits car, scm_t_bits cdr)
    */
   SCM *freelist = SCM_FREELIST_LOC (scm_i_freelist);
 
-  if (SCM_NULLP (*freelist))
+  if (scm_gc_running_p)
+    {
+      abort();
+    }
+  
+  if (scm_is_null (*freelist))
     z = scm_gc_for_newcell (&scm_i_master_freelist, freelist);
   else
     {
@@ -93,7 +103,7 @@ scm_cell (scm_t_bits car, scm_t_bits cdr)
            fprintf(stderr, "scm_cell tried to allocate a marked cell.\n");
            abort();
          }
-       else if (SCM_GC_CELL_TYPE(z) != scm_tc_free_cell)
+       else if (SCM_GC_CELL_WORD(z, 0) != scm_tc_free_cell)
          {
            fprintf(stderr, "cell from freelist is not a free cell.\n");
            abort();
@@ -145,7 +155,12 @@ scm_cell (scm_t_bits car, scm_t_bits cdr)
 
 #if defined SCM_C_INLINE && ! defined SCM_INLINE_C_INCLUDING_INLINE_H
 /* definitely inlining */
-extern SCM_C_INLINE
+#ifdef __GNUC__
+extern
+#else
+static
+#endif
+SCM_C_INLINE
 #endif
 SCM
 scm_double_cell (scm_t_bits car, scm_t_bits cbr,
@@ -154,7 +169,12 @@ scm_double_cell (scm_t_bits car, scm_t_bits cbr,
   SCM z;
   SCM *freelist = SCM_FREELIST_LOC (scm_i_freelist2);
 
-  if (SCM_NULLP (*freelist))
+  if (scm_gc_running_p)
+    {
+      abort();
+    }
+
+  if (scm_is_null (*freelist))
     z = scm_gc_for_newcell (&scm_i_master_freelist2, freelist);
   else
     {