summaryrefslogtreecommitdiff
path: root/src/VBox/GuestHost/OpenGL/include/cr_string.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/GuestHost/OpenGL/include/cr_string.h
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/include/cr_string.h')
-rw-r--r--src/VBox/GuestHost/OpenGL/include/cr_string.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/include/cr_string.h b/src/VBox/GuestHost/OpenGL/include/cr_string.h
index 87f1df38..972d08f1 100644
--- a/src/VBox/GuestHost/OpenGL/include/cr_string.h
+++ b/src/VBox/GuestHost/OpenGL/include/cr_string.h
@@ -36,6 +36,30 @@ DECLEXPORT(int) crIsDigit( char c );
DECLEXPORT(void) crBytesToString( char *string, int nstring, void *data, int ndata );
DECLEXPORT(void) crWordsToString( char *string, int nstring, void *data, int ndata );
+#define CR_GLVERSION_OFFSET_MAJOR (24)
+#define CR_GLVERSION_OFFSET_MINOR (16)
+#define CR_GLVERSION_OFFSET_BUILD (0)
+
+#define CR_GLVERSION_MAX_MAJOR (0x7f)
+#define CR_GLVERSION_MAX_MINOR (0xff)
+#define CR_GLVERSION_MAX_BUILD (0xffff)
+
+#define CR_GLVERSION_MASK_MAJOR (CR_GLVERSION_MAX_MAJOR << CR_GLVERSION_OFFSET_MAJOR)
+#define CR_GLVERSION_MASK_MINOR (CR_GLVERSION_MAX_MINOR << CR_GLVERSION_OFFSET_MINOR)
+#define CR_GLVERSION_MASK_BUILD (CR_GLVERSION_MAX_BUILD << CR_GLVERSION_OFFSET_BUILD)
+
+#define CR_GLVERSION_COMPOSE_EL(_val, _type) (((_val) << CR_GLVERSION_OFFSET_##_type) & CR_GLVERSION_MASK_##_type)
+
+#define CR_GLVERSION_COMPOSE(_maj, _min, _build) (CR_GLVERSION_COMPOSE_EL((_maj), MAJOR) \
+ + CR_GLVERSION_COMPOSE_EL((_min), MINOR) \
+ + CR_GLVERSION_COMPOSE_EL((_build), BUILD))
+
+#define CR_GLVERSION_GET_EL(_val, _type) (((_val) & CR_GLVERSION_MASK_##_type) >> CR_GLVERSION_OFFSET_##_type)
+#define CR_GLVERSION_GET_MAJOR(_val) CR_GLVERSION_GET_EL((_val), MAJOR)
+#define CR_GLVERSION_GET_MINOR(_val) CR_GLVERSION_GET_EL((_val), MINOR)
+#define CR_GLVERSION_GET_BUILD(_val) CR_GLVERSION_GET_EL((_val), BUILD)
+
+DECLEXPORT(int) crStrParseGlVersion(const char * ver);
RT_C_DECLS_END
#endif /* CR_STRING_H */