Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_bitmask.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_RW_BITMASK_H_INCLUDED
33#define _RWSTD_RW_BITMASK_H_INCLUDED
34
35#ifndef _RWSTD_RW_DEFS_H_INCLUDED
36# include <rw/_defs.h>
37#endif // _RWSTD_RW_DEFS_H_INCLUDED
38
39
40#ifndef _RWSTD_NO_STATIC_CONST_MEMBER_INIT
41# define _RWSTD_BITMASK_ENUM(Bitmask) Bitmask
42
43# define _RWSTD_DEFINE_BITMASK_OPERATORS(Bitmask) \
44 \
45 inline Bitmask& operator&= (Bitmask &__lhs, Bitmask __rhs) { \
46 return __lhs = Bitmask (long (__lhs) & __rhs); \
47 } \
48 \
49 inline Bitmask& operator|= (Bitmask &__lhs, Bitmask __rhs) { \
50 return __lhs = Bitmask (long (__lhs) | __rhs); \
51 } \
52 \
53 inline Bitmask& operator^= (Bitmask &__lhs, Bitmask __rhs) { \
54 return __lhs = Bitmask (long (__lhs) ^ __rhs); \
55 } \
56 \
57 inline Bitmask operator& (Bitmask __lhs, Bitmask __rhs) { \
58 return __lhs &= __rhs; \
59 } \
60 \
61 inline Bitmask operator| (Bitmask __lhs, Bitmask __rhs) { \
62 return __lhs |= __rhs; \
63 } \
64 \
65 inline Bitmask operator^ (Bitmask __lhs, Bitmask __rhs) { \
66 return __lhs ^= __rhs; \
67 } \
68 \
69 inline Bitmask operator~ (Bitmask __rhs) { \
70 return Bitmask (~long (__rhs)); \
71 } \
72 typedef void __rw_unused_typedef
73
74#else // if defined (_RWSTD_NO_STATIC_CONST_MEMBER_INIT)
75# define _RWSTD_BITMASK_ENUM(ignore) int
76
77# define _RWSTD_DEFINE_BITMASK_OPERATORS(ignore) \
78 typedef void __rw_unused_typedef
79
80#endif // _RWSTD_NO_STATIC_CONST_MEMBER_INIT
81
82
83#endif // _RWSTD_RW_BITMASK_H_INCLUDED