[Scummvm-devel] remove macro conflict in system headers

Икар fedor_qd at mail.ru
Wed Oct 30 21:35:28 CET 2013


When I building Tsage engine for symbian with GCCE 4.4.1 I got many erros "macro `remove' used without args" because compilers think what function :
virtual void remove()=0
and his virtual inheritance comes from macro definition
#define remove(x) unlink(x)
This define placed in sys/unistd.h

 I try to  use '#undef remove' in core.h but it doesn't work. How I can hide this macro from compiler? Comment-build-uncoment works but this is bad style.

be on the safe side I rewrite this in russan.
Когда я собирал Tsage под симбиан я получил много ошибок вида "macro `remove' used without args". Причина - компилятор считает, что функция remove - это встроеный в libc макрос #define remove(x) unlink(x). Использование директивы "#undef remove" не помогло. Как его скрыть от компилятора? Пока делаю так  - закомментировал-собрал-раскоментировал.

 Logs:
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:33,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/tsage.h:31,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:28:
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:33,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/tsage.h:31,
D:\Symbian\Projects\SDL\scummvm\engines\tsage/graphics.h:198: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/graphics.h:338: macro `remove' used without args
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:28:
D:\Symbian\Projects\SDL\scummvm\engines\tsage/graphics.h:198: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/graphics.h:338: macro `remove' used without args
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/tsage.h:31,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:28:
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:126: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:148: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:197: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:300: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:333: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:348: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:422: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:510: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:592: macro `remove' used without args
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/tsage.h:31,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:28:
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:126: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:148: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:197: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:300: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:333: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:348: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:422: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:510: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/core.h:592: macro `remove' used without args
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:28,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/scenes.h:27,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/globals.h:29,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:32:
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:28,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/scenes.h:27,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/globals.h:29,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:32:
D:\Symbian\Projects\SDL\scummvm\engines\tsage/sound.h:446: macro `remove' used without args
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/scenes.h:27,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/globals.h:29,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:32:
D:\Symbian\Projects\SDL\scummvm\engines\tsage/sound.h:446: macro `remove' used without args
In file included from D:\Symbian\Projects\SDL\scummvm\engines\tsage/scenes.h:27,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage/globals.h:29,
                 from D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:32:
D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:65: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:65: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:93: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:239: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:93: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage/converse.h:239: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:427: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:456: macro `remove' used without args
D:\Symbian\Projects\SDL\scummvm\engines\tsage\blue_force\blueforce_dialogs.cpp:427: macro `remove' used without args

----------------------------------------------------------------------

С уважением, Федор Стрижнёв.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20131031/678a88b0/attachment.html>


More information about the Scummvm-devel mailing list