home *** CD-ROM | disk | FTP | other *** search
- // stock.h
- //
- // (C) Copyright 1995 - 1999 Microsoft Corporation. All rights reserved.
- //
-
- #ifndef __STOCK_H__
- #define __STOCK_H__
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- #pragma warning(disable:4100) // "unreferenced formal parameter" warning
- #pragma warning(disable:4505) // unreferenced local function
-
- #pragma warning(disable:4035)
-
- #define CCNT_OVERHEAD64 13
-
- static
- __int64 GetCycleCount64()
- {
- __asm _emit 0x0F
- __asm _emit 0x31
- };
-
- #define CCNT_OVERHEAD32 13
-
- static
- unsigned GetCycleCount32() // enough for about 40 seconds
- {
- __asm push EDX
- __asm _emit 0x0F
- __asm _emit 0x31
- __asm pop EDX
- };
-
- #pragma warning(default:4035)
-
- #ifdef DEBUG
-
- extern BOOL FailedAssertion (PCSTR file, ULONG line, PCSTR cond);
-
- #define ASSERT(cond) { if (!(cond)) FailedAssertion(__FILE__, __LINE__, #cond); }
- #define EVAL(cond) ((cond) || FailedAssertion(__FILE__, __LINE__, #cond))
-
- #else
-
- #define ASSERT(cond)
- #define EVAL(cond) (cond)
-
- #endif
-
- #define ARRAY_ELEMENTS(rg) (sizeof(rg)/sizeof((rg)[0]))
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __STOCK_H__ */
-
-