-
Notifications
You must be signed in to change notification settings - Fork 8
/
uf_glib.h
47 lines (40 loc) · 1.41 KB
/
uf_glib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* UFRaw - Unidentified Flying Raw converter for digital camera images
*
* uf_glib.h - glib compatibility header
* Copyright 2004-2016 by Udi Fuchs
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef _UF_GLIB_H
#define _UF_GLIB_H
#include <glib.h>
#include <glib/gstdio.h>
#ifdef __cplusplus
extern "C" {
#endif
// g_win32_locale_filename_from_utf8 is needed only on win32
#ifdef _WIN32
#define uf_win32_locale_filename_from_utf8(__some_string__) \
g_win32_locale_filename_from_utf8(__some_string__)
#define uf_win32_locale_filename_free(__some_string__) g_free(__some_string__)
#else
#define uf_win32_locale_filename_from_utf8(__some_string__) (__some_string__)
#define uf_win32_locale_filename_free(__some_string__) (void)(__some_string__)
#endif
// On win32 command-line arguments need to be translated to UTF-8
#ifdef _WIN32
#define uf_win32_locale_to_utf8(__some_string__) \
g_locale_to_utf8(__some_string__, -1, NULL, NULL, NULL)
#define uf_win32_locale_free(__some_string__) g_free(__some_string__)
#else
#define uf_win32_locale_to_utf8(__some_string__) (__some_string__)
#define uf_win32_locale_free(__some_string__) (void)(__some_string__)
#endif
#ifdef __cplusplus
}
#endif
#endif /*_UF_GLIB_H*/