Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.98 KB | None | 0 0
  1. /* xatomic0.h internal header */
  2. #pragma once
  3. #ifndef _XATOMIC0_H
  4. #define _XATOMIC0_H
  5. #ifndef RC_INVOKED
  6. #include <yvals.h>
  7.  
  8.  #pragma pack(push,_CRT_PACKING)
  9.  #pragma warning(push,_STL_WARNING_LEVEL)
  10.  #pragma warning(disable: _STL_DISABLED_WARNINGS)
  11.  #pragma push_macro("new")
  12.  #undef new
  13.  
  14. _STD_BEGIN
  15.         /* ENUM memory_order */
  16. typedef enum memory_order {
  17.     memory_order_relaxed,
  18.     memory_order_consume,
  19.     memory_order_acquire,
  20.     memory_order_release,
  21.     memory_order_acq_rel,
  22.     memory_order_seq_cst
  23.     } memory_order;
  24.  
  25. typedef _Uint32t _Uint4_t;
  26. typedef _Uint4_t _Atomic_integral_t;
  27.  
  28.     /* SET SIZES AND FLAGS FOR COMPILER AND TARGET ARCHITECTURE */
  29.     /* Note: the xxx_SIZE macros are used to generate function names,
  30.         so they must expand to the digits representing
  31.         the number of bytes in the type; they cannot be expressions
  32.         that give the number of bytes. */
  33.  
  34.   #define _WCHAR_T_SIZE     2
  35.   #define _SHORT_SIZE       2
  36.   #define _INT_SIZE         4
  37.   #define _LONG_SIZE        4
  38.   #define _LONGLONG_SIZE    8
  39.  
  40.   #if defined(_WIN64)
  41.    #define _ADDR_SIZE   8
  42.   #else /* defined(_WIN64) */
  43.    #define _ADDR_SIZE   4
  44.   #endif /* defined(_WIN64) */
  45.  
  46.         /* ATOMIC REFERENCE COUNTING */
  47. typedef _Atomic_integral_t _Atomic_counter_t;
  48.  
  49. inline _Atomic_integral_t
  50.     _Get_atomic_count(const _Atomic_counter_t& _Counter)
  51.     {   // get counter
  52.     return (_Counter);
  53.     }
  54.  
  55.  #ifndef _USE_INTERLOCKED_REFCOUNTING
  56.   #if defined(_M_IX86) || defined(_M_X64) || defined(_M_CEE_PURE)
  57.    #define _USE_INTERLOCKED_REFCOUNTING 1
  58.   #else /* defined(_M_IX86) || defined(_M_X64) || defined(_M_CEE_PURE) */
  59.    #define _USE_INTERLOCKED_REFCOUNTING 0
  60.   #endif /* defined(_M_IX86) || defined(_M_X64) || defined(_M_CEE_PURE) */
  61.  #endif /* _USE_INTERLOCKED_REFCOUNTING */
  62.  
  63. _STD_END
  64.  #pragma pop_macro("new")
  65.  #pragma warning(pop)
  66.  #pragma pack(pop)
  67. #endif /* RC_INVOKED */
  68. #endif /* _XATOMIC0_H */
  69.  
  70. /*
  71.  * Copyright (c) by P.J. Plauger. All rights reserved.
  72.  * Consult your license regarding permissions and restrictions.
  73. V6.50:0009 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement