Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
main_wrapper.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2017 Tobias Ellinghaus.
4 Copyright (C) 2022 Martin Baƙinka.
5
6 darktable is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 darktable is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with darktable. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef DT_WIN_MAIN_WRAPPER_H
20#define DT_WIN_MAIN_WRAPPER_H
21
22#include <glib.h>
23
24// On Windows the command line arguments are ANSI encoded. We want UTF-8 in dt though.
25// including this file will add a wrapper that acts together with linker switch -municode
26
27int main(int argc, char *argv[]);
28
29int wmain(int argc, wchar_t *argv[])
30{
31 char **_argv = g_malloc0((argc + 1) * sizeof(char *));
32 for(int i = 0; i < argc; i++)
33 _argv[i] = g_utf16_to_utf8(argv[i], -1, NULL, NULL, NULL);
34 int res = main(argc, _argv);
35 g_strfreev(_argv);
36 return res;
37}
38
39#endif // DT_WIN_MAIN_WRAPPER_H
40
41// clang-format off
42// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
43// vim: shiftwidth=2 expandtab tabstop=2 cindent
44// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
45// clang-format on
46
const int res
Definition dtpthread.h:351
int wmain(int argc, wchar_t *argv[])
int main()
Definition prova.c:47