Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d129689 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 21834 into eclair

* changes:
  Allow '//'-style comments in #defines.
parents 29f34260 0b1827a5
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -3821,8 +3821,20 @@ class Compiler : public ErrorSink {
            inp();
        }
        String value;
        bool appendToValue = true;
        while (ch != '\n' && ch != EOF) {
            // Check for '//' comments.
            if (appendToValue && ch == '/') {
                inp();
                if (ch == '/') {
                    appendToValue = false;
                } else {
                    value.append('/');
                }
            }
            if (appendToValue && ch != EOF) {
                value.append(ch);
            }
            inp();
        }
        char* pDefn = (char*)mGlobalArena.alloc(value.len() + 1);
+3 −2
Original line number Diff line number Diff line
// Simple tests of the C preprocessor

#define A (1 + 2)
#define A (4 / 2)
#define B 1 // This is a comment. With a / in it.

int main() {
    return A;
    return A + B;
}