define-module for elisp special modules
[bpt/guile.git] / libguile / _scm.h
index 7dd188d..97ddaf2 100644 (file)
@@ -3,7 +3,8 @@
 #ifndef SCM__SCM_H
 #define SCM__SCM_H
 
-/* Copyright (C) 1995,1996,2000,2001, 2002, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 2000, 2001, 2002, 2006, 2008, 2009, 2010,
+ *   2011, 2013, 2014 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 License
 #ifdef vms
 # ifndef __GNUC__
 #  include <ssdef.h>
-#   define SCM_SYSCALL(line)                                    \
-  do                                                            \
-    {                                                           \
-      errno = 0;                                                \
-      line;                                                     \
-      if (EVMSERR==errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3)) \
-        {                                                       \
-          SCM_ASYNC_TICK;                                       \
-          continue;                                             \
-        }                                                       \
-    }                                                           \
-  while(0)
+#   define SCM_SYSCALL(line)                                           \
+  do                                                                   \
+    {                                                                  \
+      errno = 0;                                                       \
+      line;                                                            \
+      if (EVMSERR == errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3))      \
+       SCM_ASYNC_TICK;                                                 \
+      else                                                             \
+       break;                                                          \
+    }                                                                  \
+  while (1)
 # endif /* ndef __GNUC__ */
 #endif /* def vms */
 #endif /* ndef SCM_SYSCALL  */
 #ifndef SCM_SYSCALL
 # ifdef EINTR
 #  if (EINTR > 0)
-#   define SCM_SYSCALL(line)                    \
-  do                                            \
-    {                                           \
-      errno = 0;                                \
-      line;                                     \
-      if (errno == EINTR)                       \
-        {                                       \
-          SCM_ASYNC_TICK;                       \
-          continue;                             \
-        }                                       \
-    }                                           \
-  while(0)
+#   define SCM_SYSCALL(line)                   \
+  do                                           \
+    {                                          \
+      errno = 0;                               \
+      line;                                    \
+      if (errno == EINTR)                      \
+       {                                       \
+         SCM_ASYNC_TICK;                       \
+         errno = EINTR;                        \
+       }                                       \
+    }                                          \
+  while (errno == EINTR)
 #  endif /*  (EINTR > 0) */
 # endif /* def EINTR */
 #endif /* ndef SCM_SYSCALL */
@@ -225,25 +225,23 @@ void scm_ia64_longjmp (scm_i_jmp_buf *, int);
 
 \f
 
-#define SCM_ASYNC_TICK                                                  \
-  do                                                                    \
-    {                                                                   \
-      if (SCM_UNLIKELY (SCM_I_CURRENT_THREAD->pending_asyncs))          \
-        scm_async_tick ();                                              \
-    }                                                                   \
-  while (0)
-
-#define SCM_ASYNC_TICK_WITH_CODE(thr, stmt)                             \
+#define SCM_ASYNC_TICK_WITH_GUARD_CODE(thr, pre, post)                  \
   do                                                                    \
     {                                                                   \
       if (SCM_UNLIKELY (thr->pending_asyncs))                           \
         {                                                               \
-          stmt;                                                         \
+          pre;                                                          \
           scm_async_tick ();                                            \
+          post;                                                         \
         }                                                               \
     }                                                                   \
   while (0)
 
+#define SCM_ASYNC_TICK_WITH_CODE(thr, stmt) \
+  SCM_ASYNC_TICK_WITH_GUARD_CODE (thr, stmt, (void) 0)
+#define SCM_ASYNC_TICK \
+  SCM_ASYNC_TICK_WITH_CODE (SCM_I_CURRENT_THREAD, (void) 0)
+
 
 \f
 
@@ -270,7 +268,7 @@ void scm_ia64_longjmp (scm_i_jmp_buf *, int);
 
 /* Major and minor versions must be single characters. */
 #define SCM_OBJCODE_MAJOR_VERSION 3
-#define SCM_OBJCODE_MINOR_VERSION 1
+#define SCM_OBJCODE_MINOR_VERSION 6
 #define SCM_OBJCODE_MAJOR_VERSION_STRING        \
   SCM_CPP_STRINGIFY(SCM_OBJCODE_MAJOR_VERSION)
 #define SCM_OBJCODE_MINOR_VERSION_STRING        \
@@ -280,13 +278,6 @@ void scm_ia64_longjmp (scm_i_jmp_buf *, int);
 #define SCM_OBJCODE_MACHINE_VERSION_STRING                              \
   SCM_OBJCODE_ENDIANNESS "-" SCM_OBJCODE_WORD_SIZE "-" SCM_OBJCODE_VERSION_STRING
 
-/* The objcode magic header.  */
-#define SCM_OBJCODE_COOKIE                              \
-  "GOOF----" SCM_OBJCODE_MACHINE_VERSION_STRING
-#define SCM_OBJCODE_ENDIANNESS_OFFSET 8
-#define SCM_OBJCODE_WORD_SIZE_OFFSET 11
-
-
 #endif  /* SCM__SCM_H */
 
 /*