1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy and Damien Doligez, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1999-11-17 10:59:06 -08:00
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
|
|
|
/* under the terms of the GNU Library General Public License. */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
/* Miscellaneous macros and variables. */
|
|
|
|
|
|
|
|
#ifndef _misc_
|
|
|
|
#define _misc_
|
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
/* Standard definitions */
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
/* Basic types and constants */
|
|
|
|
|
|
|
|
typedef size_t asize_t;
|
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
#define NULL 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef char * addr;
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
/* Works only in GCC 2.5 and later */
|
|
|
|
#define Noreturn __attribute ((noreturn))
|
|
|
|
#else
|
|
|
|
#define Noreturn
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Assertions */
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define Assert(x) if (!(x)) failed_assert ( #x , __FILE__, __LINE__)
|
1999-11-08 09:08:10 -08:00
|
|
|
void failed_assert (char *, char *, int) Noreturn;
|
1995-05-04 03:15:53 -07:00
|
|
|
#else
|
|
|
|
#define Assert(x)
|
|
|
|
#endif
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
void fatal_error (char *) Noreturn;
|
|
|
|
void fatal_error_arg (char *, char *) Noreturn;
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
/* GC flags and messages */
|
|
|
|
|
|
|
|
extern int verb_gc;
|
1998-08-07 11:43:39 -07:00
|
|
|
void gc_message (int, char *, unsigned long);
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
/* Memory routines */
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
void memmov (char *, char *, unsigned long);
|
|
|
|
char *aligned_malloc (asize_t, int, void **);
|
1997-05-13 07:45:38 -07:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
1997-09-02 05:55:01 -07:00
|
|
|
unsigned long not_random (void);
|
1997-05-13 07:45:38 -07:00
|
|
|
#endif
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
#endif /* _misc_ */
|