Cycles: Use 1-based line number for #line directives
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 8 Mar 2017 11:45:18 +0000 (12:45 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 8 Mar 2017 11:45:18 +0000 (12:45 +0100)
AMD CPU platform was complaining about #line 0 directives in the code.

intern/cycles/util/util_path.cpp

index 5df262fcbbb7ec05988456191e6ea9ec9ef3f8ca..1b2e8aace5b6518244fadd299c8251843b12fc3b 100644 (file)
@@ -814,7 +814,7 @@ string path_source_replace_includes(const string& source,
                                                /* Use line directives for better error messages. */
                                                line = line_directive(filepath, 1)
                                                     + token.replace(0, n_end + 1, "\n" + text + "\n")
-                                                    + line_directive(path_join(path, source_filename), i);
+                                                    + line_directive(path_join(path, source_filename), i + 1);
                                        }
                                }
                        }