Skip to content

Invalid Signed Integer Literal (-2147483648) in RenderingServer.hpp Causes Cross-Compiler Error #1822

@CycloneRing

Description

@CycloneRing

Godot version

4.5.beta

godot-cpp version

latest

System information

Windows 11 - MSVC

Issue description

There's a compiler issue after adding CANVAS_LAYER_MIN to godot-cpp, After compiling the library and headers there will be :

	static const int CANVAS_LAYER_MIN = -2147483648;
	static const int CANVAS_LAYER_MAX = 2147483647;

Which causes error in compile :

godot_cpp\classes\rendering_server.hpp(805,38): error C4146: unary minus operator applied to unsigned type, result still unsigned.

Here's the lines from extension_api.json

{
	"name": "CANVAS_LAYER_MIN",
	"value": -2147483648 <- TYPO
},
{
	"name": "CANVAS_LAYER_MAX",
	"value": 2147483647
}

Steps to reproduce

  1. Clone godot-cpp repo
  2. Build
  3. Link against GDExtension with usage of Rendering Server

How to fix :

Change -2147483648 to -2147483647 or use (-2147483647 - 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions