- Edited
Strange. Mine doesn't have an error for that:
I'm doing the same thing. One gdshaderinc with the define, another gdshaderinc with the ClampCosine that includes the first file, then a gdshader file that includes the second file.
Which version of Godot are you using? Shader macros was a recent addition, its new enough that the 4.0 docs say it doesn't exist (they explicitly state GLSL macros like #define can't be easily ported to Godot). It's working for me in 4.0 beta 3 and 4.0 alpha 15, but it might be broken earlier than that.
Another idea: what does the end of definitions.gdshaderinc look like? Maybe there's a stray character or something that is coming in with the include and affecting the ClampCosine (since it's the first thing after the include that isn't a comment).