home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / Profiler / sampmon / stock.h < prev   
Encoding:
C/C++ Source or Header  |  2000-05-04  |  1.1 KB  |  64 lines

  1. // stock.h
  2. //
  3. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  4. //
  5.  
  6. #ifndef __STOCK_H__
  7. #define __STOCK_H__
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13.  
  14. #pragma warning(disable:4100)  // "unreferenced formal parameter" warning
  15. #pragma warning(disable:4505)  // unreferenced local function
  16.  
  17. #pragma warning(disable:4035)
  18.  
  19. #define CCNT_OVERHEAD64 13
  20.  
  21. static
  22. __int64         GetCycleCount64()
  23. {
  24. __asm   _emit   0x0F
  25. __asm   _emit   0x31
  26. };
  27.  
  28. #define CCNT_OVERHEAD32 13
  29.  
  30. static
  31. unsigned        GetCycleCount32()        // enough for about 40 seconds
  32. {
  33. __asm   push    EDX
  34. __asm   _emit   0x0F
  35. __asm   _emit   0x31
  36. __asm   pop     EDX
  37. };
  38.  
  39. #pragma warning(default:4035)
  40.  
  41. #ifdef DEBUG
  42.  
  43. extern BOOL FailedAssertion (PCSTR file, ULONG line, PCSTR cond);
  44.  
  45. #define ASSERT(cond) { if (!(cond)) FailedAssertion(__FILE__, __LINE__, #cond); }
  46. #define EVAL(cond) ((cond) || FailedAssertion(__FILE__, __LINE__, #cond))
  47.  
  48. #else
  49.  
  50. #define ASSERT(cond)
  51. #define EVAL(cond) (cond)
  52.  
  53. #endif
  54.  
  55. #define ARRAY_ELEMENTS(rg) (sizeof(rg)/sizeof((rg)[0]))
  56.  
  57.  
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61.  
  62. #endif /* __STOCK_H__ */
  63.  
  64.