Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test.c.ref « src « create-native-map - github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a4943402870b1fbdf7aeb78259f13ef69026dc00 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
/*
 * This file was automatically generated by create-native-map from TestMap.dll.
 *
 * DO NOT MODIFY.
 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* ndef HAVE_CONFIG_H */

#include <stdlib.h>
#include <string.h>

/*
 * Implementation Macros
 */
#ifndef FOO
#define FOO "foo"
#endif /* ndef FOO */


/*
 * Implementation Includes
 */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* ndef HAVE_UNISTD_H */
#include <stdio.h>
#include "test.h"

#include "test.h"

#include <errno.h>    /* errno, EOVERFLOW */
#include <glib.h>     /* g* types, g_assert_not_reached() */

#if defined (G_MININT8)
#define CNM_MININT8 G_MININT8
#else
#define CNM_MININT8 (-128)
#endif

#if defined (G_MAXINT8)
#define CNM_MAXINT8 G_MAXINT8
#else
#define CNM_MAXINT8 (127)
#endif

#if defined (G_MAXUINT8)
#define CNM_MAXUINT8 G_MAXUINT8
#else
#define CNM_MAXUINT8 (255)
#endif

#if defined (G_MININT16)
#define CNM_MININT16 G_MININT16
#else
#define CNM_MININT16 (-32768)
#endif

#if defined (G_MAXINT16)
#define CNM_MAXINT16 G_MAXINT16
#else
#define CNM_MAXINT16 (32767)
#endif

#if defined (G_MAXUINT16)
#define CNM_MAXUINT16 G_MAXUINT16
#else
#define CNM_MAXUINT16 (65535)
#endif

#if defined (G_MININT32)
#define CNM_MININT32 G_MININT32
#else
#define CNM_MININT32 (-2147483648)
#endif

#if defined (G_MAXINT32)
#define CNM_MAXINT32 G_MAXINT32
#else
#define CNM_MAXINT32 (2147483647)
#endif

#if defined (G_MAXUINT32)
#define CNM_MAXUINT32 G_MAXUINT32
#else
#define CNM_MAXUINT32 (4294967295U)
#endif

#if defined (G_MININT64)
#define CNM_MININT64 G_MININT64
#else
#define CNM_MININT64 (-9223372036854775808LL)
#endif

#if defined (G_MAXINT64)
#define CNM_MAXINT64 G_MAXINT64
#else
#define CNM_MAXINT64 (9223372036854775807LL)
#endif

#if defined (G_MAXUINT64)
#define CNM_MAXUINT64 G_MAXUINT64
#else
#define CNM_MAXUINT64 (18446744073709551615ULL)
#endif


/* returns TRUE if @type is an unsigned type */
#define _cnm_integral_type_is_unsigned(type) \
    (sizeof(type) == sizeof(gint8)           \
      ? (((type)-1) > CNM_MAXINT8)             \
      : sizeof(type) == sizeof(gint16)       \
        ? (((type)-1) > CNM_MAXINT16)          \
        : sizeof(type) == sizeof(gint32)     \
          ? (((type)-1) > CNM_MAXINT32)        \
          : sizeof(type) == sizeof(gint64)   \
            ? (((type)-1) > CNM_MAXINT64)      \
            : (g_assert_not_reached (), 0))

/* returns the minimum value of @type as a gint64 */
#define _cnm_integral_type_min(type)          \
    (_cnm_integral_type_is_unsigned (type)    \
      ? 0                                     \
      : sizeof(type) == sizeof(gint8)         \
        ? CNM_MININT8                           \
        : sizeof(type) == sizeof(gint16)      \
          ? CNM_MININT16                        \
          : sizeof(type) == sizeof(gint32)    \
            ? CNM_MININT32                      \
            : sizeof(type) == sizeof(gint64)  \
              ? CNM_MININT64                    \
              : (g_assert_not_reached (), 0))

/* returns the maximum value of @type as a guint64 */
#define _cnm_integral_type_max(type)            \
    (_cnm_integral_type_is_unsigned (type)      \
      ? sizeof(type) == sizeof(gint8)           \
        ? CNM_MAXUINT8                            \
        : sizeof(type) == sizeof(gint16)        \
          ? CNM_MAXUINT16                         \
          : sizeof(type) == sizeof(gint32)      \
            ? CNM_MAXUINT32                       \
            : sizeof(type) == sizeof(gint64)    \
              ? CNM_MAXUINT64                     \
              : (g_assert_not_reached (), 0)    \
      : sizeof(type) == sizeof(gint8)           \
          ? CNM_MAXINT8                           \
          : sizeof(type) == sizeof(gint16)      \
            ? CNM_MAXINT16                        \
            : sizeof(type) == sizeof(gint32)    \
              ? CNM_MAXINT32                      \
              : sizeof(type) == sizeof(gint64)  \
                ? CNM_MAXINT64                    \
                : (g_assert_not_reached (), 0))

#ifdef _CNM_DUMP
#define _cnm_dump(to_t,from)                                             \
  printf ("# %s -> %s: uns=%i; min=%llx; max=%llx; value=%llx; lt=%i; l0=%i; gt=%i; e=%i\n", \
    #from, #to_t,                                                        \
    (int) _cnm_integral_type_is_unsigned (to_t),                         \
    (gint64) (_cnm_integral_type_min (to_t)),                            \
    (gint64) (_cnm_integral_type_max (to_t)),                            \
    (gint64) (from),                                                     \
    (((gint64) _cnm_integral_type_min (to_t)) <= (gint64) from),         \
    (from < 0),                                                          \
    (((guint64) from) <= (guint64) _cnm_integral_type_max (to_t)),       \
    !((int) _cnm_integral_type_is_unsigned (to_t)                        \
      ? ((0 <= from) &&                                                  \
         ((guint64) from <= (guint64) _cnm_integral_type_max (to_t)))    \
      : ((gint64) _cnm_integral_type_min(to_t) <= (gint64) from &&       \
         (guint64) from <= (guint64) _cnm_integral_type_max (to_t)))     \
  )
#else /* ndef _CNM_DUMP */
#define _cnm_dump(to_t, from) do {} while (0)
#endif /* def _CNM_DUMP */

#ifdef DEBUG
#define _cnm_return_val_if_overflow(to_t,from,val)  G_STMT_START {   \
    int     uns = _cnm_integral_type_is_unsigned (to_t);             \
    gint64  min = (gint64)  _cnm_integral_type_min (to_t);           \
    guint64 max = (guint64) _cnm_integral_type_max (to_t);           \
    gint64  sf  = (gint64)  from;                                    \
    guint64 uf  = (guint64) from;                                    \
    if (!(uns ? ((0 <= from) && (uf <= max))                         \
              : (min <= sf && (from < 0 || uf <= max)))) {           \
      _cnm_dump(to_t, from);                                         \
      errno = EOVERFLOW;                                             \
      return (val);                                                  \
    }                                                                \
  } G_STMT_END
#else /* !def DEBUG */
/* don't do any overflow checking */
#define _cnm_return_val_if_overflow(to_t,from,val)  G_STMT_START {   \
  } G_STMT_END
#endif /* def DEBUG */

int MakeMap_Test_FromFlagsEnum (int x, int *r)
{
	*r = 0;
	if ((x & MakeMap_Test_FlagsEnum_A) == MakeMap_Test_FlagsEnum_A)
#ifdef A
		*r |= A;
#else /* def A */
		{errno = EINVAL; return -1;}
#endif /* ndef A */
	if ((x & MakeMap_Test_FlagsEnum_All) == MakeMap_Test_FlagsEnum_All)
#ifdef All
		*r |= All;
#else /* def All */
		{/* Ignoring MakeMap_Test_FlagsEnum_All, as it is constructed from other values */}
#endif /* ndef All */
	if ((x & MakeMap_Test_FlagsEnum_B) == MakeMap_Test_FlagsEnum_B)
#ifdef B
		*r |= B;
#else /* def B */
		{errno = EINVAL; return -1;}
#endif /* ndef B */
	if ((x & MakeMap_Test_FlagsEnum_C) == MakeMap_Test_FlagsEnum_C)
#ifdef C
		*r |= C;
#else /* def C */
		{errno = EINVAL; return -1;}
#endif /* ndef C */
	if ((x & MakeMap_Test_FlagsEnum_D) == MakeMap_Test_FlagsEnum_D)
#ifdef D
		*r |= D;
#else /* def D */
		{errno = EINVAL; return -1;}
#endif /* ndef D */
	if ((x & MakeMap_Test_FlagsEnum_None) == MakeMap_Test_FlagsEnum_None)
#ifdef None
		*r |= None;
#else /* def None */
		{errno = EINVAL; return -1;}
#endif /* ndef None */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFBLK)
#ifdef S_IFBLK
		*r |= S_IFBLK;
#else /* def S_IFBLK */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFBLK */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFCHR)
#ifdef S_IFCHR
		*r |= S_IFCHR;
#else /* def S_IFCHR */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFCHR */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFDIR)
#ifdef S_IFDIR
		*r |= S_IFDIR;
#else /* def S_IFDIR */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFDIR */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFIFO)
#ifdef S_IFIFO
		*r |= S_IFIFO;
#else /* def S_IFIFO */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFIFO */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFLNK)
#ifdef S_IFLNK
		*r |= S_IFLNK;
#else /* def S_IFLNK */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFLNK */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFMT)
#ifdef S_IFMT
		*r |= S_IFMT;
#else /* def S_IFMT */
		{/* Ignoring MakeMap_Test_FlagsEnum_S_IFMT, as it is constructed from other values */}
#endif /* ndef S_IFMT */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFREG)
#ifdef S_IFREG
		*r |= S_IFREG;
#else /* def S_IFREG */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFREG */
	if ((x & MakeMap_Test_FlagsEnum_S_IFMT) == MakeMap_Test_FlagsEnum_S_IFSOCK)
#ifdef S_IFSOCK
		*r |= S_IFSOCK;
#else /* def S_IFSOCK */
		{errno = EINVAL; return -1;}
#endif /* ndef S_IFSOCK */
	if (x == 0)
		return 0;
	return 0;
}

int MakeMap_Test_ToFlagsEnum (int x, int *r)
{
	*r = 0;
	if (x == 0)
		return 0;
#ifdef A
	if ((x & A) == A)
		*r |= MakeMap_Test_FlagsEnum_A;
#endif /* ndef A */
#ifdef All
	if ((x & All) == All)
		*r |= MakeMap_Test_FlagsEnum_All;
#endif /* ndef All */
#ifdef B
	if ((x & B) == B)
		*r |= MakeMap_Test_FlagsEnum_B;
#endif /* ndef B */
#ifdef C
	if ((x & C) == C)
		*r |= MakeMap_Test_FlagsEnum_C;
#endif /* ndef C */
#ifdef D
	if ((x & D) == D)
		*r |= MakeMap_Test_FlagsEnum_D;
#endif /* ndef D */
#ifdef None
	if ((x & None) == None)
		*r |= MakeMap_Test_FlagsEnum_None;
#endif /* ndef None */
#ifdef S_IFBLK
	if ((x & S_IFMT) == S_IFBLK)
		*r |= MakeMap_Test_FlagsEnum_S_IFBLK;
#endif /* ndef S_IFBLK */
#ifdef S_IFCHR
	if ((x & S_IFMT) == S_IFCHR)
		*r |= MakeMap_Test_FlagsEnum_S_IFCHR;
#endif /* ndef S_IFCHR */
#ifdef S_IFDIR
	if ((x & S_IFMT) == S_IFDIR)
		*r |= MakeMap_Test_FlagsEnum_S_IFDIR;
#endif /* ndef S_IFDIR */
#ifdef S_IFIFO
	if ((x & S_IFMT) == S_IFIFO)
		*r |= MakeMap_Test_FlagsEnum_S_IFIFO;
#endif /* ndef S_IFIFO */
#ifdef S_IFLNK
	if ((x & S_IFMT) == S_IFLNK)
		*r |= MakeMap_Test_FlagsEnum_S_IFLNK;
#endif /* ndef S_IFLNK */
#ifdef S_IFMT
	if ((x & S_IFMT) == S_IFMT)
		*r |= MakeMap_Test_FlagsEnum_S_IFMT;
#endif /* ndef S_IFMT */
#ifdef S_IFREG
	if ((x & S_IFMT) == S_IFREG)
		*r |= MakeMap_Test_FlagsEnum_S_IFREG;
#endif /* ndef S_IFREG */
#ifdef S_IFSOCK
	if ((x & S_IFMT) == S_IFSOCK)
		*r |= MakeMap_Test_FlagsEnum_S_IFSOCK;
#endif /* ndef S_IFSOCK */
	return 0;
}

#ifdef HAVE_STRUCT_FOO
int
MakeMap_Test_FromFoo (struct MakeMap_Test_Foo *from, struct foo *to)
{
	_cnm_return_val_if_overflow (int, from->foo, -1);
#ifdef HAVE_STRUCT_FOO_AUTOCONF_ME
	_cnm_return_val_if_overflow (gint64, from->autoconf_me, -1);
#endif /* ndef HAVE_STRUCT_FOO_AUTOCONF_ME */

	memset (to, 0, sizeof(*to));

	to->foo         = from->foo;
	to->p           = from->p;
#ifdef HAVE_STRUCT_FOO_AUTOCONF_ME
	to->autoconf_me = from->autoconf_me;
#endif /* ndef HAVE_STRUCT_FOO_AUTOCONF_ME */

	return 0;
}
#endif /* ndef HAVE_STRUCT_FOO */


#ifdef HAVE_STRUCT_FOO
int
MakeMap_Test_ToFoo (struct foo *from, struct MakeMap_Test_Foo *to)
{
	_cnm_return_val_if_overflow (int, from->foo, -1);
#ifdef HAVE_STRUCT_FOO_AUTOCONF_ME
	_cnm_return_val_if_overflow (gint64, from->autoconf_me, -1);
#endif /* ndef HAVE_STRUCT_FOO_AUTOCONF_ME */

	memset (to, 0, sizeof(*to));

	to->foo         = from->foo;
	to->p           = from->p;
#ifdef HAVE_STRUCT_FOO_AUTOCONF_ME
	to->autoconf_me = from->autoconf_me;
#endif /* ndef HAVE_STRUCT_FOO_AUTOCONF_ME */

	return 0;
}
#endif /* ndef HAVE_STRUCT_FOO */


#ifdef HAVE_STRUCT_FOO_HOLDER
int
MakeMap_Test_FromFooHolder (struct MakeMap_Test_FooHolder *from, struct foo_holder *to)
{

	memset (to, 0, sizeof(*to));

	if (MakeMap_Test_FromFoo (&from->foo, &to->foo) != 0) {
		return -1;
	}
	if (MakeMap_Test_FromTestEnum (from->mode, &to->mode) != 0) {
		return -1;
	}

	return 0;
}
#endif /* ndef HAVE_STRUCT_FOO_HOLDER */


#ifdef HAVE_STRUCT_FOO_HOLDER
int
MakeMap_Test_ToFooHolder (struct foo_holder *from, struct MakeMap_Test_FooHolder *to)
{

	memset (to, 0, sizeof(*to));

	if (MakeMap_Test_ToFoo (&from->foo, &to->foo) != 0) {
		return -1;
	}
	if (MakeMap_Test_ToTestEnum (from->mode, &to->mode) != 0) {
		return -1;
	}

	return 0;
}
#endif /* ndef HAVE_STRUCT_FOO_HOLDER */


int MakeMap_Test_FromSimpleFlagsEnum (int x, int *r)
{
	*r = 0;
	if ((x & MakeMap_Test_SimpleFlagsEnum_A) == MakeMap_Test_SimpleFlagsEnum_A)
#ifdef A
		*r |= A;
#else /* def A */
		{errno = EINVAL; return -1;}
#endif /* ndef A */
	if ((x & MakeMap_Test_SimpleFlagsEnum_B) == MakeMap_Test_SimpleFlagsEnum_B)
#ifdef B
		*r |= B;
#else /* def B */
		{errno = EINVAL; return -1;}
#endif /* ndef B */
	if ((x & MakeMap_Test_SimpleFlagsEnum_C) == MakeMap_Test_SimpleFlagsEnum_C)
#ifdef C
		*r |= C;
#else /* def C */
		{errno = EINVAL; return -1;}
#endif /* ndef C */
	if ((x & MakeMap_Test_SimpleFlagsEnum_D) == MakeMap_Test_SimpleFlagsEnum_D)
#ifdef D
		*r |= D;
#else /* def D */
		{errno = EINVAL; return -1;}
#endif /* ndef D */
	if ((x & MakeMap_Test_SimpleFlagsEnum_None) == MakeMap_Test_SimpleFlagsEnum_None)
#ifdef None
		*r |= None;
#else /* def None */
		{errno = EINVAL; return -1;}
#endif /* ndef None */
	if (x == 0)
		return 0;
	return 0;
}

int MakeMap_Test_ToSimpleFlagsEnum (int x, int *r)
{
	*r = 0;
	if (x == 0)
		return 0;
#ifdef A
	if ((x & A) == A)
		*r |= MakeMap_Test_SimpleFlagsEnum_A;
#endif /* ndef A */
#ifdef B
	if ((x & B) == B)
		*r |= MakeMap_Test_SimpleFlagsEnum_B;
#endif /* ndef B */
#ifdef C
	if ((x & C) == C)
		*r |= MakeMap_Test_SimpleFlagsEnum_C;
#endif /* ndef C */
#ifdef D
	if ((x & D) == D)
		*r |= MakeMap_Test_SimpleFlagsEnum_D;
#endif /* ndef D */
#ifdef None
	if ((x & None) == None)
		*r |= MakeMap_Test_SimpleFlagsEnum_None;
#endif /* ndef None */
	return 0;
}

int MakeMap_Test_FromTestEnum (gint64 x, gint64 *r)
{
	*r = 0;
	if (x == MakeMap_Test_TestEnum_Bar)
#ifdef Bar
		{*r = Bar; return 0;}
#else /* def Bar */
		{errno = EINVAL; return -1;}
#endif /* ndef Bar */
	if (x == MakeMap_Test_TestEnum_Baz)
#ifdef Baz
		{*r = Baz; return 0;}
#else /* def Baz */
		{errno = EINVAL; return -1;}
#endif /* ndef Baz */
	if (x == MakeMap_Test_TestEnum_Foo)
#ifdef Foo
		{*r = Foo; return 0;}
#else /* def Foo */
		{errno = EINVAL; return -1;}
#endif /* ndef Foo */
	if (x == MakeMap_Test_TestEnum_Qux)
#ifdef Qux
		{*r = Qux; return 0;}
#else /* def Qux */
		{errno = EINVAL; return -1;}
#endif /* ndef Qux */
	if (x == 0)
		return 0;
	errno = EINVAL; return -1;
}

int MakeMap_Test_ToTestEnum (gint64 x, gint64 *r)
{
	*r = 0;
	if (x == 0)
		return 0;
#ifdef Bar
	if (x == Bar)
		{*r = MakeMap_Test_TestEnum_Bar; return 0;}
#endif /* ndef Bar */
#ifdef Baz
	if (x == Baz)
		{*r = MakeMap_Test_TestEnum_Baz; return 0;}
#endif /* ndef Baz */
#ifdef Foo
	if (x == Foo)
		{*r = MakeMap_Test_TestEnum_Foo; return 0;}
#endif /* ndef Foo */
#ifdef Qux
	if (x == Qux)
		{*r = MakeMap_Test_TestEnum_Qux; return 0;}
#endif /* ndef Qux */
	errno = EINVAL; return -1;
}

int MakeMap_Rename_FromColors (int x, int *r)
{
	*r = 0;
	if (x == MakeMap_Rename_Colors_Blue)
#ifdef Blue
		{*r = Blue; return 0;}
#else /* def Blue */
		{errno = EINVAL; return -1;}
#endif /* ndef Blue */
	if (x == MakeMap_Rename_Colors_Green)
#ifdef Green
		{*r = Green; return 0;}
#else /* def Green */
		{errno = EINVAL; return -1;}
#endif /* ndef Green */
	if (x == MakeMap_Rename_Colors_Red)
#ifdef Red
		{*r = Red; return 0;}
#else /* def Red */
		{errno = EINVAL; return -1;}
#endif /* ndef Red */
	if (x == 0)
		return 0;
	errno = EINVAL; return -1;
}

int MakeMap_Rename_ToColors (int x, int *r)
{
	*r = 0;
	if (x == 0)
		return 0;
#ifdef Blue
	if (x == Blue)
		{*r = MakeMap_Rename_Colors_Blue; return 0;}
#endif /* ndef Blue */
#ifdef Green
	if (x == Green)
		{*r = MakeMap_Rename_Colors_Green; return 0;}
#endif /* ndef Green */
#ifdef Red
	if (x == Red)
		{*r = MakeMap_Rename_Colors_Red; return 0;}
#endif /* ndef Red */
	errno = EINVAL; return -1;
}