OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / setup.h
diff --git a/tstools/DtsEdit/src/gpac/setup.h b/tstools/DtsEdit/src/gpac/setup.h
new file mode 100644 (file)
index 0000000..3edc13a
--- /dev/null
@@ -0,0 +1,377 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005\r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / general OS configuration file\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_SETUP_H_\r
+#define _GF_SETUP_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*WIN32 and WinCE config*/\r
+#if defined(WIN32) || defined(_WIN32_WCE)\r
+\r
+#ifdef GPAC_HAVE_CONFIG_H\r
+\r
+#if defined(__GNUC__)\r
+#include <gpac/internal/config.h>\r
+#else\r
+#include <gpac/internal/config_static.h>\r
+#endif\r
+\r
+#endif\r
+\r
+/*common win32 parts*/\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+\r
+typedef unsigned __int64 u64;\r
+typedef unsigned int u32;\r
+typedef unsigned short u16;\r
+typedef unsigned char u8;\r
+typedef __int64 s64;\r
+typedef int s32;\r
+typedef short s16;\r
+typedef char s8;\r
+\r
+#if defined(__GNUC__)\r
+#define GFINLINE inline\r
+#else\r
+#define GFINLINE __inline\r
+#endif\r
+\r
+#define GF_PATH_SEPARATOR      '\\'\r
+#define GF_MAX_PATH    1024\r
+\r
+/*WINCE config*/\r
+#if defined(_WIN32_WCE)\r
+\r
+/*winCE read-only (smaller)*/\r
+#ifndef GPAC_READ_ONLY\r
+#define GPAC_READ_ONLY\r
+#endif\r
+\r
+/*winCE always fixed-point*/\r
+#ifndef GPAC_FIXED_POINT\r
+#define GPAC_FIXED_POINT\r
+#endif\r
+\r
+/*win32 assert*/\r
+#ifndef assert\r
+\r
+void CE_Assert(u32 valid, char *file, u32 line);\r
+\r
+#ifndef NDEBUG\r
+#define assert( t )    CE_Assert((unsigned int) (t), __FILE__, __LINE__ )\r
+#else\r
+#define assert(t)\r
+#endif\r
+\r
+#endif\r
+\r
+\r
+/*performs wide->char and char->wide conversion on a buffer GF_MAX_PATH long*/\r
+void CE_WideToChar(unsigned short *w_str, char *str);\r
+void CE_CharToWide(char *str, unsigned short *w_str);\r
+\r
+\r
+#define strdup _strdup\r
+#define stricmp _stricmp\r
+#define strnicmp _strnicmp\r
+#define strupr _strupr\r
+\r
+#ifndef _PTRDIFF_T_DEFINED\r
+typedef int ptrdiff_t;\r
+#define PTRDIFF(p1, p2, type)  ((p1) - (p2))\r
+#define _PTRDIFF_T_DEFINED\r
+#endif\r
+\r
+#ifndef _SIZE_T_DEFINED\r
+typedef unsigned int size_t;\r
+#define _SIZE_T_DEFINED\r
+#endif\r
+\r
+#ifndef offsetof\r
+#define offsetof(s,m) ((size_t)&(((s*)0)->m))\r
+#endif\r
+\r
+#ifndef getenv\r
+#define getenv(a) 0L\r
+#endif\r
+\r
+#define strupr _strupr\r
+#define strlwr _strlwr\r
+\r
+//#define GPAC_DISABLE_LOG\r
+\r
+#else  /*END WINCE*/\r
+\r
+/*WIN32 not-WinCE*/\r
+#include <ctype.h>\r
+#include <string.h>\r
+#include <float.h>\r
+#include <limits.h>\r
+#include <stdarg.h>\r
+#include <assert.h>\r
+\r
+\r
+#endif /*END WIN32 non win-ce*/\r
+/*end WIN32 config*/\r
+\r
+/*start SYMBIAN config*/\r
+#elif defined(__SYMBIAN32__)\r
+\r
+#define GFINLINE inline\r
+#define GF_PATH_SEPARATOR      '\\'\r
+\r
+/*we must explicitely export our functions...*/\r
+#define GF_EXPORT EXPORT_C\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <stdarg.h>\r
+#include <limits.h>\r
+#include <ctype.h>\r
+#include <string.h>\r
+#include <assert.h>\r
+\r
+#ifdef __SERIES60_3X__\r
+\r
+typedef unsigned __int64 u64;\r
+typedef __int64 s64;\r
+\r
+#else \r
+\r
+/*FIXME - we don't have 64bit support here we should get rid of all 64bits divisions*/\r
+//typedef unsigned long long u64;\r
+//typedef long long s64;\r
+\r
+typedef unsigned int u64;\r
+typedef signed int s64;\r
+\r
+#endif /*symbian 8*/\r
+\r
+/*SYMBIAN always fixed-point*/\r
+#ifndef GPAC_FIXED_POINT\r
+#define GPAC_FIXED_POINT\r
+#endif\r
+\r
+\r
+typedef unsigned int u32;\r
+typedef unsigned short u16;\r
+typedef unsigned char u8;\r
+typedef int s32;\r
+typedef short s16;\r
+typedef signed char s8;\r
+\r
+#pragma mpwc_relax on\r
+\r
+#define GF_MAX_PATH    260\r
+\r
+/*sorry this was developed under w32 :)*/\r
+#define stricmp                strcasecmp\r
+#define strnicmp       strncasecmp\r
+\r
+#ifndef strupr\r
+char * my_str_upr(char *str);\r
+#define strupr my_str_upr\r
+#endif\r
+\r
+#ifndef strlwr\r
+char * my_str_lwr(char *str);\r
+#define strlwr my_str_lwr\r
+#endif\r
+\r
+#ifndef DBL_MAX\r
+#include <libc/ieeefp.h>\r
+#define DBL_MAX        (__IEEE_DBL_MAXPOWTWO)\r
+#endif\r
+\r
+#ifndef FLT_MAX\r
+#include <libc/ieeefp.h>\r
+#define FLT_MAX        (__IEEE_FLT_MAXPOWTWO)\r
+#endif\r
+\r
+#ifndef FLT_EPSILON\r
+#define FLT_EPSILON 1\r
+#endif\r
+\r
+/*end SYMBIAN config*/\r
+\r
+#else \r
+\r
+/*UNIX likes*/\r
+\r
+#ifdef GPAC_HAVE_CONFIG_H\r
+#include "config.h"\r
+#endif\r
+\r
+\r
+/*force large file support*/\r
+#ifndef _FILE_OFFSET_BITS\r
+#define _FILE_OFFSET_BITS 64\r
+#endif\r
+#ifndef _LARGEFILE_SOURCE\r
+#define _LARGEFILE_SOURCE\r
+#endif\r
+#ifndef _LARGEFILE64_SOURCE\r
+#define _LARGEFILE64_SOURCE\r
+#endif\r
+\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <stdarg.h>\r
+#include <limits.h>\r
+#include <float.h>\r
+#include <ctype.h>\r
+#include <string.h>\r
+#include <assert.h>\r
+\r
+\r
+typedef uint64_t u64;\r
+typedef uint32_t u32;\r
+typedef uint16_t u16;\r
+typedef uint8_t u8;\r
+typedef int64_t s64;\r
+typedef int32_t s32;\r
+typedef int16_t s16;\r
+typedef int8_t s8;\r
+\r
+#define GFINLINE       inline\r
+\r
+/*sorry this was developed under w32 :)*/\r
+#define stricmp                strcasecmp\r
+#define strnicmp       strncasecmp\r
+\r
+#ifndef strupr\r
+char * my_str_upr(char *str);\r
+#define strupr my_str_upr\r
+#endif\r
+\r
+#ifndef strlwr\r
+char * my_str_lwr(char *str);\r
+#define strlwr my_str_lwr\r
+#endif\r
+\r
+#define GF_PATH_SEPARATOR      '/'\r
+\r
+#ifdef PATH_MAX\r
+#define GF_MAX_PATH    PATH_MAX\r
+#else\r
+/*PATH_MAX not defined*/\r
+#define GF_MAX_PATH    1023\r
+#endif\r
+\r
+\r
+#endif /* end platform specific Win32/WinCE/UNIX*/\r
+\r
+/*define what's missing*/\r
+#ifndef NULL\r
+#define NULL 0\r
+#endif\r
+\r
+\r
+typedef double Double;\r
+typedef float Float;\r
+/* 128 bit IDs */\r
+typedef u8 bin128[16];\r
+\r
+#define GF_MAX_DOUBLE          DBL_MAX\r
+#define GF_MIN_DOUBLE          -GF_MAX_DOUBLE\r
+#define GF_MAX_FLOAT           FLT_MAX\r
+#define GF_MIN_FLOAT           -GF_MAX_FLOAT\r
+#define GF_EPSILON_FLOAT       FLT_EPSILON\r
+#define GF_SHORT_MAX           SHRT_MAX\r
+#define GF_SHORT_MIN           SHRT_MIN\r
+\r
+#ifndef MIN\r
+#define MIN(X, Y) ((X)<(Y)?(X):(Y))\r
+#endif\r
+#ifndef MAX\r
+#define MAX(X, Y) ((X)>(Y)?(X):(Y))\r
+#endif\r
+\r
+#define ABSDIFF(a, b)  ( ( (a) > (b) ) ? ((a) - (b)) : ((b) - (a)) )\r
+\r
+#ifndef ABS\r
+#define ABS(a) ( ( (a) > 0 ) ? (a) : - (a) )\r
+#endif\r
+\r
+#ifndef Bool\r
+typedef u32 Bool;\r
+#endif\r
+\r
+/*GPAC memory tracking*/\r
+#define GPAC_MEMORY_TRACKING   0\r
+\r
+#if GPAC_MEMORY_TRACKING\r
+void *gf_malloc(size_t size);\r
+void *gf_realloc(void *ptr, size_t size);\r
+void gf_free(void *ptr);\r
+char *gf_strdup(const char *str);\r
+\r
+#undef malloc\r
+#define malloc gf_malloc\r
+#undef realloc\r
+#define realloc gf_realloc\r
+#undef free\r
+#define free gf_free\r
+#undef strdup\r
+#define strdup gf_strdup\r
+\r
+#endif\r
+/*end GPAC memory tracking*/\r
+\r
+#if defined (WIN32) && !defined(__GNUC__)\r
+#define LLD "%I64d"\r
+#define LLU "%I64u"\r
+#define LLD_CAST\r
+#define LLU_CAST\r
+#elif defined (__SYMBIAN32__)\r
+#define LLD "%d"\r
+#define LLU "%u"\r
+#define LLD_CAST (u32)\r
+#define LLU_CAST (s32)\r
+#else\r
+#define LLD "%lld"\r
+#define LLU "%llu"\r
+#define LLD_CAST\r
+#define LLU_CAST\r
+#endif\r
+\r
+\r
+#ifndef GF_EXPORT\r
+/*use def files for windows or let compiler decide*/\r
+#define GF_EXPORT \r
+#endif\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_SETUP_H_*/\r