summaryrefslogtreecommitdiff
path: root/libraries/base/include
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/include')
-rw-r--r--libraries/base/include/CTypes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libraries/base/include/CTypes.h b/libraries/base/include/CTypes.h
index 9fa1e4a1c1..e9d19a8401 100644
--- a/libraries/base/include/CTypes.h
+++ b/libraries/base/include/CTypes.h
@@ -19,6 +19,7 @@
#define ARITHMETIC_CLASSES Eq,Ord,Num,Enum,Storable,Real
#define INTEGRAL_CLASSES Bounded,Integral,Bits,FiniteBits
#define FLOATING_CLASSES Fractional,Floating,RealFrac,RealFloat
+#define OPAQUE_CLASSES Eq,Ord,Storable
#define ARITHMETIC_TYPE(T,B) \
newtype T = T B deriving (ARITHMETIC_CLASSES) \
@@ -42,4 +43,9 @@ newtype {-# CTYPE "THE_CTYPE" #-} T = T B \
deriving (ARITHMETIC_CLASSES, FLOATING_CLASSES) \
deriving newtype (Read, Show);
+#define OPAQUE_TYPE_WITH_CTYPE(T,THE_CTYPE,B) \
+newtype {-# CTYPE "THE_CTYPE" #-} T = T (B) \
+ deriving (OPAQUE_CLASSES) \
+ deriving newtype Show;
+
#endif