Code

Only load from preferences when really needed, which might help reducing the processo...
[inkscape.git] / src / libgdl / gdl-win32.c
1 /*
2  * Windows stuff
3  *
4  * Author:
5  *   Albin Sunnanbo
6  *   Based on code by Lauris Kaplinski <lauris@kaplinski.com> (/src/extension/internal/win32.cpp)
7  *
8  * This code is in public domain
9  */
10 #ifdef WIN32
12 #include "gdl-win32.h"
13 #include <windows.h>
15 /* Platform detection */
16 gboolean
17 is_os_vista()
18 {
19         static gboolean initialized = FALSE;
20         static gboolean is_vista = FALSE;
21         static OSVERSIONINFOA osver;
23         if ( !initialized )
24         {
25                 BOOL result;
27                 initialized = TRUE;
29                 memset (&osver, 0, sizeof(OSVERSIONINFOA));
30                 osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
31                 result = GetVersionExA (&osver);
32                 if (result)
33                 {
34                         if (osver.dwMajorVersion == WIN32_MAJORVERSION_VISTA)
35                                 is_vista = TRUE;
36                 }
37         }
39         return is_vista;
40 }
42 #endif