/*------------------------------------------------------------------------------*
 * File Name: common.h															*
 * Creation: CPY 7/14/2001														*
 * Purpose: OriginC header with common typedef and macros, must be included		*
 * Copyright (c) OriginLab Corp.	2001										*
 * All Rights Reserved															*
 * 																				*
 * Modification Log:															*
 *------------------------------------------------------------------------------*/
#ifndef _OC_COMMON_H
#define _OC_COMMON_H

typedef unsigned int size_t;

typedef int BOOL;
typedef void* LPVOID;
typedef const void* LPCVOID;
typedef const char* LPCSTR;
#define LPCTSTR	LPCSTR
typedef char* LPSTR;
///---------------------------- TD 8-15-01 
//typedef unsigned int UINT;
//#define DWORD	UINT
//#define	USHORT	WORD
#define DWORD	uint
#define	USHORT	ushort
#define WORD	ushort
#define BYTE	byte
#define String  string
//#define Vector  vector
//#define Matrix	matrix
#define UINT	uint
#define Application		Project
///------------------------ end TD 8-15-01 
typedef int LONG;
typedef int long;

#define SEEK_CUR    1
#define SEEK_END    2
#define SEEK_SET    0


#define HWND		LPVOID
#define	HANDLE		LPVOID

#define WINAPI      __stdcall

#define TRUE 	1
#define FALSE 	0

//-----------------------------------------------------
// the following should be defined only for debug build
#define _DEBUG // this is usful during development
//
#ifdef _DEBUG
	#define	DEBUG_MSG(str)	str.WriteLine(WRITE_COMPILER_OUTPUT)
#else
	#define	DEBUG_MSG(str)	str.Write(WRITE_MESSAGE_BOX)
#endif
#define OUT(str)		str.WriteLine(WRITE_SCRIPT_WINDOW)


#ifdef _DEBUG
	#define ASSERT(_f)	do { if (!(_f) ) OCAssertLine(__FILE__, __LINE__, 1);  } while (0)
#else
	#define ASSERT(_f)	do { if (!(_f) ) OCAssertLine(__FILE__, __LINE__, 0);  } while (0)
#endif

#pragma dll(@OK)

/**#
*/
void	OCAssertLine(LPCSTR lpcszFile, int nLineNumber, BOOL bDbg);


#define ERR_MSG(str)	{string _junk(str); OUT(_junk);}
//------------------------------------------------------

#define	_ONAN		(-1.23456789E-300)

#define WM_USER		0x0400

#endif //_OC_ORIGIN_H

