kgconfig.h
来自「AMLOGIC DPF source code」· C头文件 代码 · 共 177 行
H
177 行
/** \file
Copyright 2005 Eastman Kodak Company
This file supports building the software on different platforms. It
should be included in every file that has platform dependencies
(include it as the first header file in appropriate header files.)
This file may not be compatible with the Windows stdafx pre-compiled
header mechanism as both files should be included first. So, don't
use stdafx.
As of 12/22/05, the following platforms are supported (at least for
building and unit test:
o Windows with STL
o Windows without STL
o Sigma Designs (without STL)
*/
#ifndef K_GALLERY_CONFIG_H
#define K_GALLERY_CONFIG_H
#ifndef AVOS
/************ Test Configurations ******************/
/** turn off the ANSI assert() macro in non debug builds.
Since assert() is defined to exit() when called, you
may want to disable it at other times as well. (In
a Windows application you get the Abort, Retry, Ignore
dialog) define NO_ASSERTS to disable assert() unequivocally. */
/* _DEBUG is not universal. The following will disable assert()
in any build environment that doesn't use _DEBUG for debug builds.
Updates for such environments are welcome. */
#ifndef _DEBUG
#define NO_ASSERTS
#endif
#ifdef NO_ASSERTS
#ifndef NDEBUG
#define NDEBUG // disable ANSI assert()
#endif
#endif
/** #define to enable use of canned test data. Addtional defines
in the test data header and implementation files control
execution behavior */
//#define KG_TEST_MODE
/************ End of Test Configurations ******************/
#endif /* AVOS */
/*********** STL availability *************/
/** TODO a rather crude test for STL availability!!!
The assumption is that if we aren't building for Sigma Designs,
all the "normal" C++ stuff will be available. This is not
a robust solution.
*/
#ifdef AVOS
#include "ixml.h"
#include "xml_util.h"
#elif defined EM86XX_CHIP // i.e. building for Sigma Designs
#define KG_SIGMA_DESIGNS_BUILD
#define INCLUDE_TINY_XML_PATH "rmtinyxml/src/tinyxml/tinyxml.h"
#ifndef ALLOW_OS_CODE
#define ALLOW_OS_CODE 1
#endif //ALLOW_OS_CODE
#include "rmcore/include/rmcore.h"
#include <assert.h>
#else
#define INCLUDE_TINY_XML_PATH "tinyxml/tinyxml.h"
#include <cassert>
#endif
#ifdef TIXML_USE_STL // i.e. tinyxml is using STL
#define KG_HAVE_STL
#endif
#ifndef _WIN32
#define KG_POSIX_ENVIRONMENT // TODO anything not Windows is Posix???
#endif
// memory allocation
#ifdef AVOS
#define KGMalloc(size, count) AVMem_malloc(size * count)
#define KGFree(x) if ( x ) AVMem_free(x)
#elif defined KG_SIGMA_DESIGNS_BUILD
#define KGMalloc(size, count) RMMalloc(sizeof(size) * count)
#define KGFree(x) RMFree(x)
#else
#define KGMalloc(size, count) new size[count]
#define KGFree(x) delete [] x
#endif
#ifndef AVOS
/** For "stepping through" code with no debugger. */
// TODO this needs a conditional to get rid of it when the test class isn't being used. Or,
// it needs to be in some other file.
int y_or_n_p (const char *question);
#endif /* AVOS */
/********************** OS Standard Specific ***********************/
#ifdef KG_POSIX_ENVIRONMENT
#define kgCompareNoCase strcasecmp // Posix case insensitive string compare function
#else // ANSI (Windows)
#define kgCompareNoCase stricmp // ANSI case insensitive string compare function
#endif
/********************** end OS Specific ***********************/
/****************** type definitions ********************/
/** In Windows, _T(x) and _TEXT(x) resolve to __T(x), which resolves to L ## x
ifdef UNICODE or just x otherwise. We don't want "L" yet, at least not on Windows
as it causes string literals to be composed of "shorts" (ie. wide characters)
and we have no support for that in the rest of the code. This is something
we'll have to deal with for Unicode support. So for now, handle these macros
by ensuring they don't do anything. Note: they won't be defined unless tchar.h
somehow gets included in the build.
*/
#ifdef _T
#undef _T
#endif
#ifndef _T
#define _T(x) x
#endif
#ifdef _TEXT
#undef _TEXT
#endif
#ifndef _TEXT
#define _TEXT(x) x
#endif
#ifndef BYTE
typedef unsigned char BYTE;
#endif
// define our "char"
#ifdef KG_HAVE_STL
#define KGChar char
#elif defined KG_SIGMA_DESIGNS_BUILD
#ifndef RMascii // TODO allows building on Windows.
#define RMascii char
#endif
#define KGChar RMascii
#else
#define KGChar char
#endif
/****************** exception handling ********************/
#if defined KG_SIGMA_DESIGNS_BUILD || AVOS
#define KGTRY if(1)
#define KGCATCH(x) if(0)
#else
#define KGTRY try
#define KGCATCH(x) catch(x)
#endif
/** the following is here only because we do not have secure sockets support on
all platforms. This must never be done in scenarios where real user passwords are
in use.
*/
#define ALLOW_INSECURE_LOGIN
#ifdef ALLOW_INSECURE_LOGIN
#define KG_SECURE_LOGIN // comment this out if https is not supported
#if defined KG_SECURE_LOGIN
#define KG_USE_SECURE_LOGIN (true)
#else
#define KG_USE_SECURE_LOGIN (false)
#endif
#endif /* ALLOW_INSECURE_LOGIN */
#endif /* K_GALLERY_CONFIG_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?