uglyDwarf / linuxtrack

Headtracking for Linux/Mac
MIT License
155 stars 30 forks source link

MXML compatibility issue on OpenSuSe Tumbleweed #184

Open a-leithner opened 3 years ago

a-leithner commented 3 years ago

I was trying to build linuxtrack on the most recent build of OpenSuSe Tumbleweed with libmxml1-3.2-1.4.x86_64 installed. However, GCC was, when running make complaining that:

game_data.c: In function ‘get_game_data’:
game_data.c:142:59: error: invalid use of incomplete typedef ‘mxml_node_t’ {aka ‘struct _mxml_node_s’}
  142 |       fprintf(outfile, "%s \"%s\" (%s)\n", id, name, appid->child->value.text.string);
      |                                                           ^~

I assume that this API has changed with more recent versions of MXML (Tumbleweed is a rolling release) but that means that linuxtrack will in the future break with other distros moving to more recent library versions.

I fixed the problem by replacing the above line with:

mxml_node_t *appidChild = mxmlGetFirstChild (appid);
fprintf (outfile, "%s \"%s\" (%s)\n", id, name, mxmlGetText (appidChild, NULL));

However, as I'm unsure whether this breaks anything downstream (haven't gotten linuxtrack to build yet) or this is actually your preferred way of doing this, I have not submitted a pull request yet but am ready whenever one is needed.