Line |
Branch |
Exec |
Source |
1 |
|
|
#include <gio/gio.h> |
2 |
|
|
|
3 |
|
|
#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) |
4 |
|
|
# define SECTION __attribute__ ((section (".gresource.config_file_resources"), aligned (8))) |
5 |
|
|
#else |
6 |
|
|
# define SECTION |
7 |
|
|
#endif |
8 |
|
|
|
9 |
|
|
static const SECTION union { const guint8 data[445]; const double alignment; void * const ptr;} config_file_resources_resource_data = { |
10 |
|
|
"\107\126\141\162\151\141\156\164\000\000\000\000\000\000\000\000" |
11 |
|
|
"\030\000\000\000\344\000\000\000\000\000\000\050\007\000\000\000" |
12 |
|
|
"\000\000\000\000\000\000\000\000\001\000\000\000\004\000\000\000" |
13 |
|
|
"\005\000\000\000\005\000\000\000\006\000\000\000\113\120\220\013" |
14 |
|
|
"\003\000\000\000\344\000\000\000\004\000\114\000\350\000\000\000" |
15 |
|
|
"\354\000\000\000\243\056\304\273\004\000\000\000\354\000\000\000" |
16 |
|
|
"\030\000\166\000\010\001\000\000\062\001\000\000\023\234\071\242" |
17 |
|
|
"\006\000\000\000\062\001\000\000\022\000\114\000\104\001\000\000" |
18 |
|
|
"\110\001\000\000\324\265\002\000\377\377\377\377\110\001\000\000" |
19 |
|
|
"\001\000\114\000\114\001\000\000\120\001\000\000\130\107\147\076" |
20 |
|
|
"\002\000\000\000\120\001\000\000\007\000\114\000\130\001\000\000" |
21 |
|
|
"\140\001\000\000\257\371\305\305\004\000\000\000\140\001\000\000" |
22 |
|
|
"\020\000\166\000\160\001\000\000\261\001\000\000\260\267\044\060" |
23 |
|
|
"\000\000\000\000\261\001\000\000\006\000\114\000\270\001\000\000" |
24 |
|
|
"\274\001\000\000\157\162\147\057\006\000\000\000\143\157\156\146" |
25 |
|
|
"\151\147\055\164\145\163\164\055\151\156\166\141\154\151\144\056" |
26 |
|
|
"\143\157\156\146\000\000\000\000\032\000\000\000\000\000\000\000" |
27 |
|
|
"\164\150\151\163\040\145\156\164\040\141\040\166\141\154\151\144" |
28 |
|
|
"\040\143\157\156\146\040\146\151\154\145\000\000\050\165\165\141" |
29 |
|
|
"\171\051\154\151\142\147\163\171\163\164\145\155\163\145\162\166" |
30 |
|
|
"\151\143\145\057\004\000\000\000\057\000\000\000\000\000\000\000" |
31 |
|
|
"\143\157\156\146\151\147\057\000\001\000\000\000\005\000\000\000" |
32 |
|
|
"\143\157\156\146\151\147\055\164\145\163\164\056\143\157\156\146" |
33 |
|
|
"\061\000\000\000\000\000\000\000\133\124\145\163\164\135\012\106" |
34 |
|
|
"\151\154\145\075\061\060\060\060\012\106\151\154\145\104\145\146" |
35 |
|
|
"\141\165\154\164\075\164\162\165\145\012\012\133\104\145\146\141" |
36 |
|
|
"\165\154\164\107\162\157\165\160\135\000\000\050\165\165\141\171" |
37 |
|
|
"\051\147\156\157\155\145\057\000\002\000\000\000" }; |
38 |
|
|
|
39 |
|
|
static GStaticResource static_resource = { config_file_resources_resource_data.data, sizeof (config_file_resources_resource_data.data) - 1 /* nul terminator */, NULL, NULL, NULL }; |
40 |
|
|
|
41 |
|
|
G_GNUC_INTERNAL |
42 |
|
|
GResource *config_file_resources_get_resource (void); |
43 |
|
9 |
GResource *config_file_resources_get_resource (void) |
44 |
|
|
{ |
45 |
|
9 |
return g_static_resource_get_resource (&static_resource); |
46 |
|
|
} |
47 |
|
|
/* GLIB - Library of useful routines for C programming |
48 |
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
49 |
|
|
* |
50 |
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later |
51 |
|
|
* |
52 |
|
|
* This library is free software; you can redistribute it and/or |
53 |
|
|
* modify it under the terms of the GNU Lesser General Public |
54 |
|
|
* License as published by the Free Software Foundation; either |
55 |
|
|
* version 2.1 of the License, or (at your option) any later version. |
56 |
|
|
* |
57 |
|
|
* This library is distributed in the hope that it will be useful, |
58 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
59 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
60 |
|
|
* Lesser General Public License for more details. |
61 |
|
|
* |
62 |
|
|
* You should have received a copy of the GNU Lesser General Public |
63 |
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>. |
64 |
|
|
*/ |
65 |
|
|
|
66 |
|
|
/* |
67 |
|
|
* Modified by the GLib Team and others 1997-2000. See the AUTHORS |
68 |
|
|
* file for a list of people on the GLib Team. See the ChangeLog |
69 |
|
|
* files for a list of changes. These files are distributed with |
70 |
|
|
* GLib at ftp://ftp.gtk.org/pub/gtk/. |
71 |
|
|
*/ |
72 |
|
|
|
73 |
|
|
#ifndef __G_CONSTRUCTOR_H__ |
74 |
|
|
#define __G_CONSTRUCTOR_H__ |
75 |
|
|
|
76 |
|
|
/* |
77 |
|
|
If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and |
78 |
|
|
destructors, in a usable way, including e.g. on library unload. If not you're on |
79 |
|
|
your own. |
80 |
|
|
|
81 |
|
|
Some compilers need #pragma to handle this, which does not work with macros, |
82 |
|
|
so the way you need to use this is (for constructors): |
83 |
|
|
|
84 |
|
|
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA |
85 |
|
|
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor) |
86 |
|
|
#endif |
87 |
|
|
G_DEFINE_CONSTRUCTOR(my_constructor) |
88 |
|
|
static void my_constructor(void) { |
89 |
|
|
... |
90 |
|
|
} |
91 |
|
|
|
92 |
|
|
*/ |
93 |
|
|
|
94 |
|
|
#ifndef __GTK_DOC_IGNORE__ |
95 |
|
|
|
96 |
|
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) |
97 |
|
|
|
98 |
|
|
#define G_HAS_CONSTRUCTORS 1 |
99 |
|
|
|
100 |
|
|
#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void); |
101 |
|
|
#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void); |
102 |
|
|
|
103 |
|
|
#elif defined (_MSC_VER) && (_MSC_VER >= 1500) |
104 |
|
|
/* Visual studio 2008 and later has _Pragma */ |
105 |
|
|
|
106 |
|
|
/* |
107 |
|
|
* Only try to include gslist.h if not already included via glib.h, |
108 |
|
|
* so that items using gconstructor.h outside of GLib (such as |
109 |
|
|
* GResources) continue to build properly. |
110 |
|
|
*/ |
111 |
|
|
#ifndef __G_LIB_H__ |
112 |
|
|
#include "gslist.h" |
113 |
|
|
#endif |
114 |
|
|
|
115 |
|
|
#include <stdlib.h> |
116 |
|
|
|
117 |
|
|
#define G_HAS_CONSTRUCTORS 1 |
118 |
|
|
|
119 |
|
|
/* We do some weird things to avoid the constructors being optimized |
120 |
|
|
* away on VS2015 if WholeProgramOptimization is enabled. First we |
121 |
|
|
* make a reference to the array from the wrapper to make sure its |
122 |
|
|
* references. Then we use a pragma to make sure the wrapper function |
123 |
|
|
* symbol is always included at the link stage. Also, the symbols |
124 |
|
|
* need to be extern (but not dllexport), even though they are not |
125 |
|
|
* really used from another object file. |
126 |
|
|
*/ |
127 |
|
|
|
128 |
|
|
/* We need to account for differences between the mangling of symbols |
129 |
|
|
* for x86 and x64/ARM/ARM64 programs, as symbols on x86 are prefixed |
130 |
|
|
* with an underscore but symbols on x64/ARM/ARM64 are not. |
131 |
|
|
*/ |
132 |
|
|
#ifdef _M_IX86 |
133 |
|
|
#define G_MSVC_SYMBOL_PREFIX "_" |
134 |
|
|
#else |
135 |
|
|
#define G_MSVC_SYMBOL_PREFIX "" |
136 |
|
|
#endif |
137 |
|
|
|
138 |
|
|
#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX) |
139 |
|
|
#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX) |
140 |
|
|
|
141 |
|
|
#define G_MSVC_CTOR(_func,_sym_prefix) \ |
142 |
|
|
static void _func(void); \ |
143 |
|
|
extern int (* _array ## _func)(void); \ |
144 |
|
|
int _func ## _wrapper(void); \ |
145 |
|
|
int _func ## _wrapper(void) { _func(); g_slist_find (NULL, _array ## _func); return 0; } \ |
146 |
|
|
__pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \ |
147 |
|
|
__pragma(section(".CRT$XCU",read)) \ |
148 |
|
|
__declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper; |
149 |
|
|
|
150 |
|
|
#define G_MSVC_DTOR(_func,_sym_prefix) \ |
151 |
|
|
static void _func(void); \ |
152 |
|
|
extern int (* _array ## _func)(void); \ |
153 |
|
|
int _func ## _constructor(void); \ |
154 |
|
|
int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL, _array ## _func); return 0; } \ |
155 |
|
|
__pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \ |
156 |
|
|
__pragma(section(".CRT$XCU",read)) \ |
157 |
|
|
__declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor; |
158 |
|
|
|
159 |
|
|
#elif defined (_MSC_VER) |
160 |
|
|
|
161 |
|
|
#define G_HAS_CONSTRUCTORS 1 |
162 |
|
|
|
163 |
|
|
/* Pre Visual studio 2008 must use #pragma section */ |
164 |
|
|
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1 |
165 |
|
|
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1 |
166 |
|
|
|
167 |
|
|
#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \ |
168 |
|
|
section(".CRT$XCU",read) |
169 |
|
|
#define G_DEFINE_CONSTRUCTOR(_func) \ |
170 |
|
|
static void _func(void); \ |
171 |
|
|
static int _func ## _wrapper(void) { _func(); return 0; } \ |
172 |
|
|
__declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper; |
173 |
|
|
|
174 |
|
|
#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \ |
175 |
|
|
section(".CRT$XCU",read) |
176 |
|
|
#define G_DEFINE_DESTRUCTOR(_func) \ |
177 |
|
|
static void _func(void); \ |
178 |
|
|
static int _func ## _constructor(void) { atexit (_func); return 0; } \ |
179 |
|
|
__declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor; |
180 |
|
|
|
181 |
|
|
#elif defined(__SUNPRO_C) |
182 |
|
|
|
183 |
|
|
/* This is not tested, but i believe it should work, based on: |
184 |
|
|
* http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c |
185 |
|
|
*/ |
186 |
|
|
|
187 |
|
|
#define G_HAS_CONSTRUCTORS 1 |
188 |
|
|
|
189 |
|
|
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1 |
190 |
|
|
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1 |
191 |
|
|
|
192 |
|
|
#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \ |
193 |
|
|
init(_func) |
194 |
|
|
#define G_DEFINE_CONSTRUCTOR(_func) \ |
195 |
|
|
static void _func(void); |
196 |
|
|
|
197 |
|
|
#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \ |
198 |
|
|
fini(_func) |
199 |
|
|
#define G_DEFINE_DESTRUCTOR(_func) \ |
200 |
|
|
static void _func(void); |
201 |
|
|
|
202 |
|
|
#else |
203 |
|
|
|
204 |
|
|
/* constructors not supported for this compiler */ |
205 |
|
|
|
206 |
|
|
#endif |
207 |
|
|
|
208 |
|
|
#endif /* __GTK_DOC_IGNORE__ */ |
209 |
|
|
#endif /* __G_CONSTRUCTOR_H__ */ |
210 |
|
|
|
211 |
|
|
#ifdef G_HAS_CONSTRUCTORS |
212 |
|
|
|
213 |
|
|
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA |
214 |
|
|
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(config_file_resourcesresource_constructor) |
215 |
|
|
#endif |
216 |
|
|
G_DEFINE_CONSTRUCTOR(config_file_resourcesresource_constructor) |
217 |
|
|
#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA |
218 |
|
|
#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(config_file_resourcesresource_destructor) |
219 |
|
|
#endif |
220 |
|
|
G_DEFINE_DESTRUCTOR(config_file_resourcesresource_destructor) |
221 |
|
|
|
222 |
|
|
#else |
223 |
|
|
#warning "Constructor not supported on this compiler, linking in resources will not work" |
224 |
|
|
#endif |
225 |
|
|
|
226 |
|
1 |
static void config_file_resourcesresource_constructor (void) |
227 |
|
|
{ |
228 |
|
1 |
g_static_resource_init (&static_resource); |
229 |
|
1 |
} |
230 |
|
|
|
231 |
|
1 |
static void config_file_resourcesresource_destructor (void) |
232 |
|
|
{ |
233 |
|
1 |
g_static_resource_fini (&static_resource); |
234 |
|
1 |
} |
235 |
|
|
|