mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
bug 270830, predefined macros not defined properly
This commit is contained in:
parent
2c7e70fd47
commit
c095f65dfd
2 changed files with 15 additions and 2 deletions
|
@ -6249,4 +6249,17 @@ public class AST2Tests extends AST2BaseTest {
|
|||
IASTInitializer init = ((IASTSimpleDeclaration)declarations[index]).getDeclarators()[0].getInitializer();
|
||||
return (IBasicType)((IASTInitializerExpression)init).getExpression().getExpressionType();
|
||||
}
|
||||
|
||||
|
||||
// void test() {
|
||||
// __DATE__;
|
||||
// __FILE__;
|
||||
// __LINE__;
|
||||
// __STDC_HOSTED__;
|
||||
// __STDC_VERSION__;
|
||||
// __TIME__;
|
||||
// }
|
||||
public void testPredefinedMacroNamesC() throws Exception {
|
||||
parseAndCheckBindings(getAboveComment(), ParserLanguage.C);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,8 +81,8 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
|
|||
private static final ObjectStyleMacro __CDT_PARSER__= new ObjectStyleMacro("__CDT_PARSER__".toCharArray(), ONE); //$NON-NLS-1$
|
||||
private static final ObjectStyleMacro __cplusplus = new ObjectStyleMacro("__cplusplus".toCharArray(), ONE); //$NON-NLS-1$
|
||||
private static final ObjectStyleMacro __STDC__ = new ObjectStyleMacro("__STDC__".toCharArray(), ONE); //$NON-NLS-1$
|
||||
private static final ObjectStyleMacro __STDC_HOSTED__ = new ObjectStyleMacro("__STDC_HOSTED_".toCharArray(), ONE); //$NON-NLS-1$
|
||||
private static final ObjectStyleMacro __STDC_VERSION__ = new ObjectStyleMacro("__STDC_VERSION_".toCharArray(), "199901L".toCharArray()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
private static final ObjectStyleMacro __STDC_HOSTED__ = new ObjectStyleMacro("__STDC_HOSTED__".toCharArray(), ONE); //$NON-NLS-1$
|
||||
private static final ObjectStyleMacro __STDC_VERSION__ = new ObjectStyleMacro("__STDC_VERSION__".toCharArray(), "199901L".toCharArray()); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private static final DynamicMacro __FILE__= new FileMacro("__FILE__".toCharArray()); //$NON-NLS-1$
|
||||
private static final DynamicMacro __DATE__= new DateMacro("__DATE__".toCharArray()); //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue