Skip to content

Commit

Permalink
Update CppNet from KakCAT
Browse files Browse the repository at this point in the history
https://github.com/KakCAT/CppNet

-----------KakCAT
Hi,

I needed to get some shaders working and the wrong lines were driving me mad, so I had a look at CppNet.

It seems one of the problems is that the CPP comments did not count as a line. It was no problem if there were no #includes, but once you included a file, the #line set by CppNet to say the processor it was again in the original file was way off.

I've directly added a line into the cppcomment although I not sure where the correct place to add the new line is. The code is just a disaster, so I'm afraid of touching anything and doing it worse, so I just patched the problem with the cppcomment. (I'm sure more problems are there because of the way of handling the line count)

I also added the fix @tanis2000 mentioned, otherwise the #include counted one extra CR.

So, in example to reproduce the problem:

// line 1
// line 2
// line 3
// line 4
error
was correctly giving error in line 5 but

// line 1
// line 2
// line 3
error
was giving error in line 3 (actually should give line 2, but the second bug incremented it)

The changes are here: https://github.com/KakCAT/CppNet

I've tested it with my shaders and Kosmonaut's Deferred Engine, but other than that, should be tested just in case my test set is too small and does things worse for other shaders.
-----------
  • Loading branch information
nkast committed Jul 27, 2022
1 parent ae99519 commit 4b94b20
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<HintPath>..\ThirdParty\Dependencies\SharpDX\SharpDX.D3DCompiler.dll</HintPath>
</Reference>
<Reference Include="CppNet">
<HintPath>..\ThirdParty\Dependencies\CppNet\CppNet.dll</HintPath>
<HintPath>..\ThirdParty\CppNet\net40\CppNet.dll</HintPath>
</Reference>
<Reference Include="Nvidia.TextureTools">
<HintPath>..\ThirdParty\Dependencies\NVTT\Nvidia.TextureTools.dll</HintPath>
Expand Down
Binary file added ThirdParty/CppNet/net40/CppNet.dll
Binary file not shown.

0 comments on commit 4b94b20

Please sign in to comment.