Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-01-22 03:32:41 +0000
committerSergey Prigogin2013-01-22 04:00:08 +0000
commitedd01d163c304a05da008a80ec8460e2a7e84021 (patch)
treef041de3a346b8dd06a2077435c46eb214c93f6c3
parente03746bc79a0720ba3eafe7a022c272b46946ee0 (diff)
downloadorg.eclipse.cdt-edd01d163c304a05da008a80ec8460e2a7e84021.tar.gz
org.eclipse.cdt-edd01d163c304a05da008a80ec8460e2a7e84021.tar.xz
org.eclipse.cdt-edd01d163c304a05da008a80ec8460e2a7e84021.zip
Do not treat sizeof(bool) as unknown when __SIZEOF_BOOL__ macro is not
defined.
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java
index a084775601e..92ebd31459a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/SizeofCalculator.java
@@ -129,7 +129,11 @@ public class SizeofCalculator {
sizeof_long_long = getSize(sizeofMacros, "__SIZEOF_LONG_LONG__", maxAlignment); //$NON-NLS-1$
sizeof_int128 = getSize(sizeofMacros, "__SIZEOF_INT128__", maxAlignment); //$NON-NLS-1$
sizeof_short = getSize(sizeofMacros, "__SIZEOF_SHORT__", maxAlignment); //$NON-NLS-1$
- sizeof_bool = getSize(sizeofMacros, "__SIZEOF_BOOL__", maxAlignment); //$NON-NLS-1$
+ SizeAndAlignment size = getSize(sizeofMacros, "__SIZEOF_BOOL__", maxAlignment); //$NON-NLS-1$
+ // __SIZEOF_BOOL__ is not defined by GCC but sizeof(bool) is needed for template resolution.
+ if (size == null)
+ size = SIZE_1;
+ sizeof_bool = size;
sizeof_wchar_t = getSize(sizeofMacros, "__SIZEOF_WCHAR_T__", maxAlignment); //$NON-NLS-1$
sizeof_float = getSize(sizeofMacros, "__SIZEOF_FLOAT__", maxAlignment); //$NON-NLS-1$
sizeof_complex_float = getSizeOfPair(sizeof_float);
@@ -152,7 +156,7 @@ public class SizeofCalculator {
sizeof_long_long = null;
sizeof_int128 = size_16;
sizeof_short = null;
- sizeof_bool = null;
+ sizeof_bool = SIZE_1;
sizeof_wchar_t = null;
sizeof_float = null;
sizeof_complex_float = null;

Back to the top