2005-01-07 08:56:38 +08:00
|
|
|
/*
|
2007-01-12 13:01:58 +08:00
|
|
|
Copyright (c) 2004-2007 Jay Sorg
|
2006-12-18 12:32:45 +08:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included
|
|
|
|
in all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
2005-01-07 08:56:38 +08:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-06-28 11:04:36 +08:00
|
|
|
#if !defined(ARCH_H)
|
|
|
|
#define ARCH_H
|
|
|
|
|
2005-01-07 08:56:38 +08:00
|
|
|
/* check endianess */
|
2005-12-09 11:10:16 +08:00
|
|
|
#if defined(__sparc__) || defined(__PPC__)
|
2005-07-11 03:17:09 +08:00
|
|
|
#define B_ENDIAN
|
|
|
|
#elif __BYTE_ORDER == __LITTLE_ENDIAN
|
2005-01-07 08:56:38 +08:00
|
|
|
#define L_ENDIAN
|
|
|
|
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
|
|
#define B_ENDIAN
|
|
|
|
#endif
|
|
|
|
/* check if we need to align data */
|
|
|
|
#if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \
|
|
|
|
defined(__AIX__) || defined(__PPC__) || defined(__mips__) || \
|
|
|
|
defined(__ia64__)
|
|
|
|
#define NEED_ALIGN
|
|
|
|
#endif
|
|
|
|
|
2005-03-01 09:14:37 +08:00
|
|
|
/* defines for thread creation factory functions */
|
|
|
|
#if defined(_WIN32)
|
2005-01-07 08:56:38 +08:00
|
|
|
#define THREAD_RV unsigned long
|
|
|
|
#define THREAD_CC __stdcall
|
|
|
|
#else
|
|
|
|
#define THREAD_RV void*
|
|
|
|
#define THREAD_CC
|
|
|
|
#endif
|
2005-06-28 11:04:36 +08:00
|
|
|
|
|
|
|
#if defined(__BORLANDC__)
|
2005-07-03 02:38:04 +08:00
|
|
|
#define APP_CC __fastcall
|
2005-06-28 11:04:36 +08:00
|
|
|
#define DEFAULT_CC __cdecl
|
|
|
|
#else
|
|
|
|
#define APP_CC
|
|
|
|
#define DEFAULT_CC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_WIN32)
|
2005-07-03 02:38:04 +08:00
|
|
|
#define EXPORT_CC _export __cdecl
|
2005-06-28 11:04:36 +08:00
|
|
|
#else
|
|
|
|
#define EXPORT_CC
|
|
|
|
#endif
|
|
|
|
|
2007-04-11 11:37:42 +08:00
|
|
|
typedef char ti8;
|
|
|
|
typedef unsigned char tui8;
|
|
|
|
typedef signed char tsi8;
|
|
|
|
typedef short ti16;
|
|
|
|
typedef unsigned short tui16;
|
|
|
|
typedef signed short tsi16;
|
|
|
|
typedef int ti32;
|
|
|
|
typedef unsigned int tui32;
|
|
|
|
typedef signed int tsi32;
|
|
|
|
typedef long tbus;
|
|
|
|
|
2005-06-28 11:04:36 +08:00
|
|
|
#endif
|