Enum to_string() trigger glib include in posix profile
Code example
enum Sus {
a, b, c;
}
void main() {
var a = Sus.a;
a.to_string();
}
C side
/* v.c generated by valac 0.50.3, the Vala compiler
* generated from v.vala, do not modify */
#include <glib-object.h>
typedef enum {
SUS_a,
SUS_b,
SUS_c
} Sus;
void _vala_main (void);
static const char* _sus_to_string (Sus value);
static const char*
_sus_to_string (Sus value)
{
switch (value) {
case SUS_a:
return "SUS_a";
case SUS_b:
return "SUS_b";
case SUS_c:
return "SUS_c";
}
return NULL;
}
void
_vala_main (void)
{
Sus a = 0;
a = SUS_a;
_sus_to_string (a);
}
int
main (int argc,
char ** argv)
{
_vala_main ();
return 0;
}
If remove #include <glib-object.h>
C code is still valid.
Edited by gavr