Skip to content

glib-mkenums: feature use of previous symbols in evaluation

Patrick Monnerat requested to merge monnerat/glib:mkenums into main

Enum symbols can be defined with a value computed from previously defined enum symbols. The current evaluator does not support this and requires a literal integer expression.

This commit introduces a C symbol namespace that is filled along code generation and provided as a local namespace for new symbols evaluation, effectively allowing definitions such as:

	typedef enum {
	  a = 4;
	  b = a + 2;
	}  myenum;

to be successfully processed.

Merge request reports