GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
inc
gmCoreGlobalDefs.h
Go to the documentation of this file.
1
/************************************************************************
2
**
3
** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4
** All rights reserved.
5
**
6
** This file is part of the "GeMA" software. It's use should respect
7
** the terms in the license agreement that can be found together
8
** with this source code.
9
** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10
** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11
** A PARTICULAR PURPOSE.
12
**
13
************************************************************************/
14
25
#ifndef _GEMA_CORE_GLOBALDEFS_H_
26
#define _GEMA_CORE_GLOBALDEFS_H_
27
28
29
/* In Visual Studio 2026, stdext::make_checked_array_iterator(x,y) and
30
stdext::make_unchecked_array_iterator(x) where removed from the runtime library.
31
Apparently, these functions where deprecated since Visual Studio 2022 v17.8
32
(_MSC_VER >= 1938) and removed in newer versions of VS2026.
33
34
Unfortunately, Qt 5 defines the macros QT_MAKE_CHECKED_ARRAY_ITERATOR() and
35
QT_MAKE_UNCHECKED_ARRAY_ITERATOR() in the file QtCore/qcompilerdetection.h, using
36
the removed functions, and without any guards. Those macros are then referenced
37
from several Qt headers, creating compiler errors in newer versions of VS2026.
38
In Qt 6 with _MSC_VER >= 1938, and for other compilers different from MSVC, those
39
macros are always empty.
40
41
A discussion of this problem can be found at https://github.com/o3de/o3de/issues/19754
42
43
One proposed solution on that thread is to force the include of <QtCore/qcompilerdetection.h>
44
and immediately redefine the macros, but that seems to be unsafe since we are NOT recompiling
45
Qt, and the application and the library will end up with different definitions for the macro.
46
47
What we do instead is to define identity implementations for make_checked_array_iterator()
48
and make_unchecked_array_iterator() when compiling with VS2026.
49
*/
50
#if _MSC_VER >= 1950
// VS2026 initial version or later
51
52
namespace
stdext
53
{
54
template
<
class
Ptr>
55
Ptr make_checked_array_iterator(
const
Ptr p,
size_t
) {
return
p; }
56
57
template
<
class
Ptr>
58
Ptr make_unchecked_array_iterator(
const
Ptr p) {
return
p; }
59
}
60
61
#endif
62
63
#endif
64
65
Generated on Mon Aug 3 2026 09:52:52 for GemaCoreLib by
1.12.0