summaryrefslogtreecommitdiff
path: root/support/dktools/dk4use.h
blob: b8331ee0ff2d548bbf9038cfaf6dbede9700b1f1 (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
/*
Copyright (C) 2019-2020, Dirk Krause
SPDX-License-Identifier: BSD-3-Clause
*/

/*
	WARNING: This file was generated by the dkct program (see
	http://dktools.sourceforge.net/ for details).
	Changes you make here will be lost if dkct is run again!
	You should modify the original source and run dkct on it.
	Original source: dk4use.ctr
*/

#ifndef DK4USE_H_INCLUDED
/** Avoid multiple inclusions. */
#define DK4USE_H_INCLUDED 1


#line 8 "dk4use.ctr"

/**	@file	dk4use.h Define constants which feature to use.
*/

#ifndef	DK4CONF_H_INCLUDED
#if DK4_BUILDING_DKTOOLS4
#include "dk4conf.h"
#else
#include <dktools-4/dk4conf.h>
#endif
#endif

/*
	For cross-compiled programs wchar_t string output failed
	after _setmode(_fileno(stdout), _O_U16TEXT);
	So we use it only when using MS C compiler.
*/
#ifndef	DK4_USE_SETMODE_UTF16
#if (_WIN32) && (DK4_CHAR_SIZE > 1) && defined(_MSC_VER) \
	&& DK4_HAVE__SETMODE && defined(_O_U16TEXT)

/**	Use _setmode() before writing wchar_t strings on Windows.
*/
#define	DK4_USE_SETMODE_UTF16	1
#else
/**	Do not use _setmode() before writing wchar_t strings on Windows.
*/
#define	DK4_USE_SETMODE_UTF16 0
#endif
#endif

/*
	Here we keep the possibility to select more detailed
	where to use _setmode(_fileno(stdout), _O_BINARY); and back.
*/
#ifndef	DK4_USE_SETMODE_BINARY
#if (_WIN32) && defined (_MSC_VER) && DK_HAVE__SETMODE && defined(_O_BINARY)
/**	Switch between binary mode and text mode.
*/
#define	DK4_USE_SETMODE_BINARY 1
#else
/**	Do not switch between binary and text mode.
*/
#define	DK4_USE_SETMODE_BINARY 0
#endif
#endif

#ifndef	DK4_USE_PRAGMA_WARNING_DISABLE
#if (_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1700)
/**	Use "pragma warning (disable:4206)" and alike.
*/
#define	DK4_USE_PRAGMA_WARNING_DISABLE	1
#else
/**	Do not use "pragma warning (disable:4206)" and alike.
*/
#define	DK4_USE_PRAGMA_WARNING_DISABLE	0
#endif
#endif

#ifndef	DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS
#if (_WIN32) && defined(_MSC_VER)
/**	Use Windows floating point exceptions.
*/
#define	DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS	1
#else
/**	Do not use Windows floating point exceptions.
*/
#define	DK4_USE_MSC_FLOATING_POINT_EXCEPTIONS	0
#endif
#endif

#ifndef	DK4_USE_PARANOID_MEMORY_CHECK
/**	Paranoid memory check is not enabled as this is self-made
	code probably decreasing performance.
	When calling dk4mem_reset_secure() this check checks each
	byte to be zero.
*/
#define	DK4_USE_PARANOID_MEMORY_CHECK			0
#endif


#endif