/* config.h
 *
 * Platform-specific config file
 *
 */

#if !defined(PARROT_CONFIG_H_GUARD)
#define PARROT_CONFIG_H_GUARD

/*
** ONLY PUT EMBEDDER-ACCESSIBLE SYMBOLS UP HERE!!!
** Other symbols may go below.
*/

#define PARROT_VERSION         "${VERSION}${DEVEL}"
#define PARROT_CONFIG_DATE     "${configdate}"
#define PARROT_MAJOR_VERSION    ${MAJOR}
#define PARROT_MINOR_VERSION    ${MINOR}
#define PARROT_PATCH_VERSION    ${PATCH}
#define PARROT_ARCHNAME        "${jitarchname}"
#define PARROT_JIT_CAPABLE      ${jitcapable}
#define PARROT_EXEC_CAPABLE     ${execcapable}
#define PARROT_DLL_EXTENSION   "${so}"

typedef ${iv}                   Parrot_Int;
typedef unsigned ${iv}          Parrot_UInt;
typedef ${nv}                   Parrot_Float;
typedef ${opcode_t}             Parrot_Opcode;
typedef void *                  Parrot_Pointer;
typedef void *                  Parrot_Sync;

typedef ${int2_t}               Parrot_Int2;
typedef unsigned ${int2_t}      Parrot_UInt2;
typedef ${int4_t}               Parrot_Int4;
typedef unsigned ${int4_t}      Parrot_UInt4;

typedef ${float4_t}             Parrot_Float4;
typedef ${float8_t}             Parrot_Float8;

/* Temporary until we find a way to make it work in the right place. */
struct PackFile;      typedef struct PackFile * Parrot_PackFile;

#if defined(PARROT_IN_CORE)

/* Put any other symbols here. */

#include <stddef.h>

#define PARROT_CPU_ARCH        "${jitcpuarch}"
#define PARROT_OS_NAME         "${jitosname}"
#define PARROT_BYTEORDER        ${byteorder}
#define PARROT_BIGENDIAN        ${bigendian}
#define PARROT_PTR_ALIGNMENT    ${ptr_alignment}

typedef Parrot_Int INTVAL;
typedef Parrot_UInt UINTVAL;
typedef Parrot_Float FLOATVAL;

typedef ${hugeintval} HUGEINTVAL;
typedef unsigned ${hugeintval} UHUGEINTVAL;
typedef ${hugefloatval} HUGEFLOATVAL;

#define INTVAL_SIZE ${intvalsize}
#define NUMVAL_SIZE ${nvsize}
#define OPCODE_T_SIZE ${opcode_t_size}
#define PTR_SIZE ${ptrsize}
#define LONG_SIZE ${longsize}

typedef Parrot_Opcode opcode_t;
typedef size_t ptrcast_t;

typedef struct _vtable VTABLE;
typedef void DPOINTER;
typedef void SYNC;

/* XXX Temporary until the grand rename is done */
typedef INTVAL   Intval;
typedef UINTVAL  UIntval;
typedef FLOATVAL Floatval;
typedef VTABLE   VTable;
typedef DPOINTER DPointer;
typedef SYNC     Sync;

/* typedef INTVAL *(*opcode_funcs)(void *, void *) OPFUNC; */

#define FRAMES_PER_CHUNK 16

/* Default amount of memory to allocate in one whack */
#define DEFAULT_SIZE 32768

#define FRAMES_PER_PMC_REG_CHUNK FRAMES_PER_CHUNK
#define FRAMES_PER_NUM_REG_CHUNK FRAMES_PER_CHUNK
#define FRAMES_PER_INT_REG_CHUNK FRAMES_PER_CHUNK
#define FRAMES_PER_STR_REG_CHUNK FRAMES_PER_CHUNK

#define JIT_CPUARCH  "${jitcpuarch}"
#define JIT_OSNAME   "${jitosname}"
#define JIT_ARCHNAME "${jitarchname}"
#define JIT_CAPABLE  ${jitcapable}
#define EXEC_CAPABLE ${execcapable}
#define PARROT_EXEC_OS_${jitosname} 1
#define PARROT_${jitcpu} 1

/*
 * Switches to turn on/off new code so people can compile
 * the core with minimal breakage.
 */
#define EXP_NETWORKING ${expnetworking}


#define PARROT_CORE_OPLIB_NAME "core"
#define PARROT_CORE_OPLIB_INIT Parrot_DynOp_core_${MAJOR}_${MINOR}_${PATCH}
#define PARROT_CORE_PREDEREF_OPLIB_INIT Parrot_DynOp_core_prederef_${MAJOR}_${MINOR}_${PATCH}
#define PARROT_CORE_SWITCH_OPLIB_INIT Parrot_DynOp_core_switch_${MAJOR}_${MINOR}_${PATCH}
#define PARROT_CORE_CG_OPLIB_INIT Parrot_DynOp_core_cg_${MAJOR}_${MINOR}_${PATCH}
#define PARROT_CORE_CGP_OPLIB_INIT Parrot_DynOp_core_cgp_${MAJOR}_${MINOR}_${PATCH}

#define INTVAL_FMT "${intvalfmt}"
#define FLOATVAL_FMT "${floatvalfmt}"

#include "parrot/has_header.h"
#include "parrot/feature.h"

#endif

#endif

/*
 * Local variables:
 * c-indentation-style: bsd
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
 *
 * vim: expandtab shiftwidth=4:
 */
