📄 hxtypes.h
字号:
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file, are
* subject to the current version of the RealNetworks Public Source License
* Version 1.0 (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the RealNetworks Community Source License Version 1.0
* (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
* in which case the RCSL will apply. You may also obtain the license terms
* directly from RealNetworks. You may not use this file except in
* compliance with the RPSL or, if you have a valid RCSL with RealNetworks
* applicable to this file, the RCSL. Please see the applicable RPSL or
* RCSL for the rights, obligations and limitations governing use of the
* contents of the file.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the portions
* it created.
*
* This file, and the files included with this file, is distributed and made
* available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#if defined(_SYMBIAN)
# include <e32def.h>
# include <e32std.h>
# include <platform/symbian/symbiantypes.h> /* For our TInt64 impl */
#endif
#ifdef _VXWORKS
#include "types/vxTypesOld.h"
#include "vxWorks.h"
/* md3 - added to override SENS macro. net/mbuf.h */
# ifdef m_flags
# undef m_flags
# endif /* m_flags */
/* md3 - added to override SENS macro, net/radix.h */
# ifdef Free
# undef Free
# endif /* Free */
#endif
#ifdef _MACINTOSH
#pragma once
#endif
#ifndef _HXTYPES_H_
#define _HXTYPES_H_
// this is essential to make sure that new is not #define'd before the C++ version is included.
#if (defined(_MSC_VER) && defined(_DEBUG) && defined(__cplusplus) && !defined(WIN32_PLATFORM_PSPC) && !defined(_SYMBIAN) && !defined(_OPENWAVE))
#include <memory>
#endif
// disable the "debug info truncated at 255" warning.
#if defined _MSC_VER
#pragma warning (disable: 4786)
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 1100) && defined(_BASETSD_H_))
#error For VC++ 6.0 or higher you must include hxtypes.h before other windows header files.
#endif
#if defined(_SYMBIAN)
typedef TInt8 INT8;
typedef TUint8 UINT8;
typedef TInt16 INT16;
typedef TUint16 UINT16;
typedef TInt32 INT32;
typedef TUint32 UINT32;
typedef TUint32 UINT; /* Its unclear, but UINT is suppose to be 32 bits. */
typedef TBool BOOL;
#else
# ifndef _VXWORKS
# if defined(QWS) && !defined(QT_CLEAN_NAMESPACE)
#error "You need to define QT_CLEAN_NAMESPACE when using Qt with Helix. If you don't you'll have conflicts with the Helix INT32, UINT32, and UINT definitions"
# endif
typedef char INT8; /* signed 8 bit value */
typedef unsigned char UINT8; /* unsigned 8 bit value */
typedef short int INT16; /* signed 16 bit value */
typedef unsigned short int UINT16; /* unsigned 16 bit value */
# if (defined _UNIX && defined _LONG_IS_64)
typedef int INT32; /* signed 32 bit value */
typedef unsigned int UINT32; /* unsigned 32 bit value */
typedef unsigned int UINT;
# elif defined _VXWORKS
typedef int INT32; /* signed 32 bit value */
typedef unsigned int UINT32; /* unsigned 32 bit value */
typedef unsigned int UINT;
# else
typedef long int INT32; /* signed 32 bit value */
typedef unsigned long int UINT32; /* unsigned 32 bit value */
typedef unsigned int UINT;
# endif /* (defined _UNIX && (defined _ALPHA || OSF1)) */
# if (defined _UNIX && defined _IRIX)
# ifdef __LONG_MAX__
# undef __LONG_MAX__
# endif
# define __LONG_MAX__ 2147483647
# endif
#ifndef BOOL
typedef int BOOL; /* signed int value (0 or 1) */
#endif
#endif /* _VXWORKS */
#endif /* _SYMBIAN */
#define ARE_BOOLS_EQUAL(a,b) (((a) && (b)) || (!(a) && !(b)))
#ifndef HX_BITFIELD
typedef unsigned char HX_BITFIELD;
#endif
typedef INT32 LONG32; /* signed 32 bit value */
typedef UINT32 ULONG32; /* unsigned 32 bit value */
#ifdef _LONG_IS_64
typedef long int INT64;
typedef unsigned long int UINT64;
#elif defined(_WINDOWS) || defined(_OPENWAVE_SIMULATOR)
typedef __int64 INT64;
typedef unsigned __int64 UINT64;
#elif defined(_SYMBIAN)
typedef SymInt64 INT64;
typedef SymInt64 UINT64;
#else
typedef long long INT64;
typedef unsigned long long UINT64;
#endif /* _WINDOWS */
/* define the float and double type for all platforms */
#define HXFLOAT float
#define HXDOUBLE double
/* Some platforms have native 64 bit int types, others don't
* so, we provide these casting macros that have to be used
* to cast 64-bit ints to smaller datatypes
*/
#if defined(_SYMBIAN)
#define INT64_TO_ULONG32(a) ((ULONG32)((a).Low()))
#define INT64_TO_UINT32(a) ((UINT32)((a).Low()))
#define INT64_TO_INT32(a) ((INT32)((a).Low()))
#define INT64_TO_DOUBLE(a) ((a).GetTReal())
#define INT64_TO_FLOAT(a) ((a).GetTReal())
#define UINT32_TO_DOUBLE(a) (SymbianUINT32toDouble(a))
#else
#define INT64_TO_ULONG32(a) ((ULONG32)(a))
#define INT64_TO_UINT32(a) ((UINT32) (a))
#define INT64_TO_INT32(a) ((INT32) (a))
#define INT64_TO_DOUBLE(a) ((double) (a))
#define INT64_TO_FLOAT(a) ((float) (a))
#define UINT32_TO_DOUBLE(a) ((double) (a))
#endif
/*
* Added for ease of reading.
* Instead of using __MWERKS__ you can now use _MACINTOSH
*/
#ifdef __MWERKS__
#if __dest_os==__macos
#ifndef _MACINTOSH
#define _MACINTOSH 1
#ifdef powerc
#define _MACPPC
#else
#define _MAC68K
#endif
#endif
#endif
#endif
#if defined(_SYMBIAN)
#define PATH_MAX KMaxPath
#endif
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
#define LANGUAGE_CODE "EN"
#ifdef _WIN16
#define MAX_PATH 260
#define PRODUCT_ID "play16"
#define PLUS_PRODUCT_ID "plus16"
#else
#define PRODUCT_ID "play32"
#define PLUS_PRODUCT_ID "plus32"
#endif
// $Private:
#define DEFAULT_CONN_TIMEOUT 20 // in seconds
#define MAX_TIMESTAMP_GAP 0x2fffffff
#if !defined(MAX_UINT32)
#define MAX_UINT32 0xffffffff
#endif /* MAX_UINT32 */
#if defined(_MACINTOSH)
#define kLetInterruptsFinishBeforeQuittingGestalt 'RN$~'
#endif
// $EndPrivate.
#define MAX_DISPLAY_NAME 256
#define HX_INVALID_VALUE (ULONG32)0xffffffff
#define HX_FREE(x) ((x) ? (free (x), (x) = 0) : 0)
#if defined(HELIX_CONFIG_NULL_DELETE_UNSAFE)
#define HX_DELETE(x) ((x) ? (delete (x), (x) = 0) : 0)
#define HX_VECTOR_DELETE(x) ((x) ? (delete [] (x), (x) = 0) : 0)
#else // defined(HELIX_CONFIG_NULL_DELETE_UNSAFE)
#define HX_DELETE(x) (delete (x), (x) = 0)
#define HX_VECTOR_DELETE(x) (delete [] (x), (x) = 0)
#endif // defined(HELIX_CONFIG_NULL_DELETE_UNSAFE)
#define RA_FILE_MAGIC_NUMBER 0x2E7261FDL /* RealAudio File Identifier */
#define RM_FILE_MAGIC_NUMBER 0x2E524D46L /* RealMedia File Identifier */
#define RIFF_FILE_MAGIC_NUMBER 0x52494646L /* RIFF (AVI etc.) File Identifier */
#ifndef _VXWORKS
typedef UINT8 UCHAR; /* unsigned 8 bit value */
#endif
typedef INT8 CHAR; /* signed 8 bit value */
typedef UINT8 BYTE;
typedef INT32 long32;
typedef UINT32 u_long32;
#ifndef _MACINTOSH
typedef INT8 Int8;
#endif
typedef UINT8 u_Int8;
typedef INT16 Int16;
typedef UINT16 u_Int16;
typedef INT32 Int32;
typedef UINT32 u_Int32;
/*
* XXXGo
* depricated...now that we need UFIXED and FIXED, this name is confusing...
* use the ones below.
*/
typedef ULONG32 UFIXED32; /* FIXED point value */
#define FLOAT_TO_FIXED(x) ((UFIXED32) ((x) * (1L << 16) + 0.5))
#define FIXED_TO_FLOAT(x) ((float) ((((float)x)/ (float)(1L <<16))))
/*
* float and fixed point value conversion
*/
#define HX_FLOAT_TO_UFIXED(x) ((UFIXED32) ((x) * (1L << 16) + 0.5))
#define HX_UFIXED_TO_FLOAT(x) ((float) ((((float)x)/ (float)(1L <<16))))
typedef LONG32 FIXED32; /* FIXED point value */
#define HX_FLOAT_TO_FIXED(x) ((FIXED32) ((x) * (1L << 16) + 0.5))
#define HX_FIXED_TO_FLOAT(x) ((float) ((((float)x)/ (float)(1L <<16))))
/*
* UFIXED32 is a 32 value where the upper 16 bits are the unsigned integer
* portion of value, and the lower 16 bits are the fractional part of the
* value
*/
typedef const char* PCSTR;
/*
* FOURCC's are 32bit codes used in Tagged File formats like
* the RealMedia file format.
*/
#ifndef FOURCC
typedef UINT32 FOURCC;
#endif
#ifndef HX_FOURCC
#define HX_FOURCC( ch0, ch1, ch2, ch3 ) \
( (UINT32)(UINT8)(ch0) | ( (UINT32)(UINT8)(ch1) << 8 ) | \
( (UINT32)(UINT8)(ch2) << 16 ) | ( (UINT32)(UINT8)(ch3) << 24 ) )
#endif
typedef UINT16 PrefKey;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef TRUE
#undef TRUE
#endif
#ifdef FALSE
#undef FALSE
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#ifndef _WINDOWS /* defined in windef.h on Windows platform */
#ifndef HIWORD
#define HIWORD(x) ((x) >> 16)
#endif
#ifndef LOWORD
#define LOWORD(x) ((x) & 0xffff)
#endif
#endif
/* Always use macro versions of these! */
#ifndef max
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
/* Should use capitalized macro versions of these, as the lowercase
versions conflict with the STL spec */
//get these from sys/param.h to avoid tons of warnings about redefining them:
#ifdef _UNIX
#include <sys/param.h>
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
/*--------------------------------------------------------------------------
| ZeroInit - initializes a block of memory with zeros
--------------------------------------------------------------------------*/
#define ZeroInit(pb) memset((void *)pb,0,sizeof(*(pb)))
#ifndef __MACTYPES__
typedef unsigned char Byte;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -