[Mesa-dev] [PATCH 1/4] glcpp: Implicitly resolve version after the first non-space/hash token.

Jon Turney jon.turney at dronecode.org.uk
Sat Mar 12 19:42:31 UTC 2016


On 10/03/2016 19:26, Kenneth Graunke wrote:
> On Wednesday, March 9, 2016 3:18:50 PM PST Jon Turney wrote:
>> On 05/03/2016 03:33, Kenneth Graunke wrote:
>>> We resolved the implicit version directive when processing control lines,
>>> such as #ifdef, to ensure any built-in macros exist.  However, we failed
>>> to resolve it when handling ordinary text.
>> [...]
>>> diff --git a/src/compiler/glsl/glcpp/tests/146-version-first-
> hash.c.expected b/src/compiler/glsl/glcpp/tests/146-version-first-
> hash.c.expected
>>> new file mode 100644
>>> index 0000000..2872090
>>> --- /dev/null
>>> +++ b/src/compiler/glsl/glcpp/tests/146-version-first-hash.c.expected
>>> @@ -0,0 +1,3 @@
>>> +0:1(3): preprocessor error: #version must appear on the first line
>>> +
>>> +
>>
>> This last test fails in glcpp-test-cr-lf for me (See attached).
>>
>> Can you just confirm that it passes for you, before I start looking into
>> why it might fail just for me...?
>
> Sorry about that.  I had just run glcpp-test, but not glcpp-test-cr-lf.
>
> It turns out that our handling of hash followed by newline was not
> counting lines correctly, so it was returning either line 3 or line 4
> based on the line terminator characters.  0:1(3) in the test was wrong;
> it should have actually been 0:2(1).
>
> Iago just reviewed my patch to fix this, so I've pushed it.  Hopefully
> master should work for you now.

Yes, that's fixed. Thanks!



More information about the mesa-dev mailing list