Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the syntax of #line and __FILE__ to support filename strings #43

Merged
merged 3 commits into from
Jul 29, 2015

Conversation

antiagainst
Copy link
Contributor

According to the GLSL spec, the second parameter to #line should be
an integer source string number and __FILE__ will be substituted
with the integer source string number currently processed. This
patch extends the syntax of #line and __FILE__. Now #line accepts
as the second parameter a filename string quoted by double quotation
marks. And if such a #line is set, __FILE__ will be substituted with
the currently set filename string. The implementation is done via
introducing a new extension GL_GOOGLE_cpp_style_line_directive using
the extension framework.

The purpose is to support cpp-style #line directives, which is
required by #include.

This commit falls into the second step listed in Issue #37.

According to the GLSL spec, the second parameter to #line should be
an integer source string number and __FILE__ will be substituted
with the integer source string number currently processed. This
patch extends the syntax of #line and __FILE__. Now #line accepts
as the second parameter a filename string quoted by double quotation
marks. And if such a #line is set, __FILE__ will be substituted with
the currently set filename string. The implementation is done via
introducing a new extension GL_GOOGLE_cpp_style_line_directive using
the extension framework.

The purpose is to support cpp-style #line directives, which is
required by #include.
@antiagainst
Copy link
Contributor Author

Of course. On it.

Use requireExtensions() to check GL_GOOGLE_cpp_style_line_directive
is turned on. Add register more tests for running.
@antiagainst
Copy link
Contributor Author

Added two more commits to address the issues.

johnkslang added a commit that referenced this pull request Jul 29, 2015
Extend the syntax of #line and __FILE__ to support filename strings.

The implementation is done via introducing a new extension 
GL_GOOGLE_cpp_style_line_directive using the extension framework.

The purpose is to support cpp-style #line directives, which is
required by #include.
@johnkslang johnkslang merged commit d9b89d3 into KhronosGroup:master Jul 29, 2015
@antiagainst antiagainst deleted the cpp-style-line-directive branch July 29, 2015 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants