summaryrefslogtreecommitdiffstats
path: root/windows.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-10-20 02:31:06 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-19 21:14:00 -0700
commit5b3e480be3c61ea790ee2a39727ffad1c3487178 (patch)
tree235fba45e16d13408dad2fe939dd813387d045c0 /windows.c
parenta75b04473fdca8fa494f18966d06d28fb096646a (diff)
downloadsubsurface-5b3e480be3c61ea790ee2a39727ffad1c3487178.tar.gz
Added a function to check if specific OS features are available
linux.c, macos.c, windows.c now contain subsurface_os_feature_available() that can accept an enum type os_feature_t defined in dive.h. The function can be useful to check if a specific global feature is available on a certain OS version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/windows.c b/windows.c
index 1c8cd0a01..2127614bd 100644
--- a/windows.c
+++ b/windows.c
@@ -223,3 +223,18 @@ void subsurface_command_line_exit(gint *argc, gchar ***argv)
g_free((*argv)[i]);
g_free(*argv);
}
+
+/* check if we are running a newer OS version */
+gboolean subsurface_os_feature_available(os_feature_t f)
+{
+ switch (f) {
+ case UTF8_FONT_WITH_STARS:
+ if ((GetVersion() & 0xff) < 6)
+ return FALSE; /* version less than Vista */
+ else
+ return TRUE;
+ break;
+ default:
+ return TRUE;
+ }
+}