FS#778 - Compile problems

Attached to Project: X-Moto
Opened by Anonymous Submitter - Saturday, 22 October 2011, 22:39 GMT
Last edited by Maxwell S. (maxwells) - Monday, 26 October 2015, 19:10 GMT
Task Type Bug Report
Category General
Status Assigned
Assigned To Maxwell S. (maxwells)
Operating System Linux
Severity High
Priority Normal
Reported Version svn
Due in Version Undecided
Due Date Undecided
Percent Complete 30%
Votes 0
Private No


Hello guys, you know, it's a really BAD idea to create header utf8.h in which you check/define __UTF8_H__ macro because on some systems, mine for example, there is a similar file /usr/include/unicode/utf8.h and guess what? It checks/defines __UTF8_H__ macro too, what a coincidence! And as far as I try to make a unicode build, both headers are included, and that system utf8.h is included first, so I get pretty errors like this:
GUI.cpp:406:22: error: 'utf8' has not been declared
GUI.cpp:406:58: error: 'utf8' has not been declared
GUI.cpp:414:11: error: 'utf8' has not been declared
GUI.cpp:416:24: error: 'utf8' has not been declared
Of cource I can move line <<#include "../../helpers/utf8.h">> to be the first one to be included (otherwise compilation fails with the above error), but I'm not sure that this way I don't lose functionality from system utf8.h.
So I offer you to rename macro to something else, __UTF8_HELPER_H__ for example not to have such collisions.
Reported Version is set to 'svn' because there is no option for 0.5.8 which is the version I have.
Sorry for rude language, very sleepy right now.
Feel free to mail me to tiacorpo@gmail.com
This task depends upon

Comment by Maxwell S. (maxwells) - Monday, 26 October 2015, 19:09 GMT
I was able to fix the problem by simply renaming the duplicate header guard. If this causes no issues, I will submit a patch.