Strict enums

pull/100/head
Nickolai Korshunov 2018-02-23 15:50:41 +03:00
parent 73a67b16b1
commit e123650d76
2 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ def generate_class_header(used_classes, c):
source.append("\n\t// enums") source.append("\n\t// enums")
for enum in c["enums"]: for enum in c["enums"]:
source.append("\tenum " + strip_name(enum["name"]) + " {") source.append("\tenum class " + strip_name(enum["name"]) + " {")
for value in enum["values"]: for value in enum["values"]:
source.append("\t\t" + remove_nested_type_prefix(value) + " = " + str(enum["values"][value]) + ",") source.append("\t\t" + remove_nested_type_prefix(value) + " = " + str(enum["values"][value]) + ",")
enum_values.append(value) enum_values.append(value)

View File

@ -4,7 +4,7 @@
namespace godot { namespace godot {
enum Error { enum class Error {
OK, OK,
FAILED, ///< Generic fail error FAILED, ///< Generic fail error
ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable ERR_UNAVAILABLE, ///< What is requested is unsupported/unavailable