/*******************************************************************************
;*******************************************************************************
;**                                                                           **
;**                  COPYRIGHT 2001-2012 NUANCE COMMUNICATIONS                **
;**                                                                           **
;**               NUANCE COMMUNICATIONS PROPRIETARY INFORMATION               **
;**                                                                           **
;**     This software is supplied under the terms of a license agreement      **
;**     or non-disclosure agreement with Nuance Communications and may not    **
;**     be copied or disclosed except in accordance with the terms of that    **
;**     agreement.                                                            **
;**                                                                           **
;*******************************************************************************
;**                                                                           **
;**     FileName: et9autilities.h                                             **
;**                                                                           **
;**  Description: Various utility functions and definitions.                  **
;**                                                                           **
;*******************************************************************************
;******************************************************************************/

#ifndef _SWUTILITIES_H_
#define _SWUTILITIES_H_ 1

/* don't mangle the function name if compile under C++ */
/*#if defined(__cplusplus) */
/*extern "C" {                      // disabled ??? */
/*#endif */

#include "et9abuildconfig.h"
#include "et9aswapicore.h"
#include "et9ageometry.h"

#include <stdlib.h>
#include <string.h>


ET9PRIVATE ET9BOOL ET9FARCALL __ET9AWSP_AssertionFailed(const char * assertion);

#define AlwaysAssert(_expr)                     ((_expr) ? _TRUE : __ET9AWSP_AssertionFailed(#_expr))

#ifdef _DEBUG
    #define DebugAssert(_expr)                  AlwaysAssert(_expr)
#else
    #define DebugAssert(_expr)                  (_expr)
#endif


/* Defining macros named min and max creates conflicts with std::min and std::max. */
/* Some system headers (gcc) undefine them as well. */
#undef min
#undef max
#define sw_min(x, y) ((x) < (y) ? (x) : (y))
#define sw_max(x, y) ((x) > (y) ? (x) : (y))


#define sw_memcmp   memcmp
#define sw_memcpy   memcpy
#define sw_memmove  memmove
#define sw_memset   memset

/*void   RecalcScreenScale(void);     // have operating system set new screen scale */
/*SBYTE2 GetScreenWidth(void);        // Get width of screen from OS */
/*SBYTE2 KBtoScreenX(SBYTE2 val);     // convert from keyboard to screen coordinates */
/*SBYTE2 KBtoScreenY(SBYTE2 val);     // convert from keyboard to screen coordinates */
/*SBYTE2 ScreenToKBX(SBYTE2 val);     // convert from screen to keyboard coordinates */
/*SBYTE2 ScreenToKBY(SBYTE2 val);     // convert from screen to keyboard coordinates */


/* End don't mangle the function name if compile under C++ */
/*#if defined(__cplusplus) */
/*    } */
/*#endif */

#endif /* _SWUTILITIES_H_ */

/* ----------------------------------< eof >--------------------------------- */
