/*
 * freescope - Free source browser
 * Copyright (C) 2001  Olivier Deme
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/*
 * MODULE:      GLOBAL
 * FILE:        arch.h
 * AUTHOR:
 * DESCRIPTION: This file defines machine dependent definitions
 */

#ifndef _ARCH_H_

#define _ARCH_H_


#ifdef __cplusplus

extern "C" {
#endif /* __cplusplus */


#ifdef HAVE_CONFIG_H

#include "config.h"

#endif /* HAVE_CONFIG_H */


/***************/
/* DEFINITIONS */
/***************/

typedef signed char          Sint8;
typedef unsigned char         Uint8;
typedef unsigned char         Octet;
typedef signed short         Sint16;
typedef unsigned short        Uint16;

#ifdef HAVE_INT32


typedef signed int         Sint32;
typedef unsigned int        Uint32;

#else /* HAVE_INT32 */


typedef struct Sint32
{
    Uint16      low;
    Sint16      high;
} Sint32;

typedef struct Uint32
{
    Uint16      low;
    Sint16      high;
} Uint32;

#define Sint32Zero(i) i.low=0;i.high=0

#define Uint32Zero(i) i.low=0;i.high=0


#endif /* HAVE_INT32 */


#ifdef HAVE_INT64


typedef signed long long         Sint64;
typedef unsigned long long        Uint64;

#else /* HAVE_INT64 */


typedef struct Sint64
{
    Uint32      low;
    Sint32      high;
} Sint64;

typedef struct Uint64
{
    Uint32      low;
    Uint32      high;
} Uint64;

#define Sint64Zero(i) i.low=0;i.high=0

#define Uint64Zero(i) i.low=0;i.high=0


#endif /* HAVE_INT64 */


#ifndef INT8MAX

#define INT8MAX        127

#endif /* INT8MAX */


#ifndef INT16MAX

#define INT16MAX       32767

#endif /* INT16MAX */


#ifndef INT32MAX

#define INT32MAX       2147483647

#endif /* INT32MAX */


#ifndef INT64MAX

#define INT64MAX       9223372036854775807

#endif /* INT64MAX */


#ifndef UINT8MAX

#define UINT8MAX       (255U)

#endif /* UINT8MAX */


#ifndef UINT16MAX

#define UINT16MAX      (65535U)

#endif /* UINT16MAX */


#ifndef UINT32MAX

#define UINT32MAX      (4294967295U)

#endif /* UINT32MAX */


#ifndef UINT64MAX

#define UINT64MAX      (18446744073709551615ULL)

#endif /* UINT64MAX */


#ifdef __cplusplus

}
#endif /* __cplusplus */


#endif /* _ARCH_H_ */




syntax highlighted by Code2HTML, v. 0.9.1