* scmsigs.h, async.h: updated.
[bpt/guile.git] / libguile / _scm.h
index 16d87c6..d866288 100644 (file)
@@ -16,7 +16,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this software; see the file COPYING.  If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307 USA
  *
  * As a special exception, the Free Software Foundation gives permission
  * for additional uses of the text contained in its release of GUILE.
@@ -40,8 +41,7 @@
  *
  * If you write modifications of your own for GUILE, it is your choice
  * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.  
- */
+ * If you do not wish that, delete this exception notice.  */
 \f
 
 #include "__scm.h"
@@ -66,8 +66,8 @@
 #include "ports.h"             /* Everyone does I/O.  */
 #include "async.h"             /* Everyone allows/disallows ints.  */
 #ifdef USE_THREADS
-#include "../threads/threads.h"        /* Some thread packages does switching
-                                  at async ticks. */
+#include "threads.h"           /* The cooperative thread package does
+                                  switching at async ticks.  */
 #endif
 #include "snarf.h"             /* Everyone snarfs. */
 
  */
 #include <errno.h>
 
-/* SCM_SYSCALL retries system calls that have been interrupted (EINTR) */
+/* SCM_SYSCALL retries system calls that have been interrupted (EINTR).
+   However this can be avoided if the operating system can restart
+   system calls automatically.  We assume this is the case if
+   sigaction is available and SA_RESTART is defined; they will be used
+   when installing signal handlers.
+   */
+
+#ifdef HAVE_RESTARTS
+#define SCM_SYSCALL(line) line
+#endif
+
+#ifndef SCM_SYSCALL
 #ifdef vms
 # ifndef __GNUC__
 #  include <ssdef.h>
@@ -84,6 +95,7 @@
        while(EVMSERR==errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3))
 # endif /* ndef __GNUC__ */
 #endif /* def vms */
+#endif /* ndef SCM_SYSCALL  */
 
 #ifndef SCM_SYSCALL
 # ifdef EINTR
 #endif /* ndef SCM_SYSCALL */
 
 #ifndef SCM_SYSCALL
-# define SCM_SYSCALL(line) {line;}
+# define SCM_SYSCALL(line) line;
 #endif /* ndef SCM_SYSCALL */
 
 #ifndef MSDOS
 
 \f
 
+#ifndef min
 #define min(A,B) ((A) <= (B) ? (A) : (B))
+#endif
+#ifndef max
 #define max(A,B) ((A) >= (B) ? (A) : (B))
+#endif
 
 #endif  /* _SCMH */