Opened 2 years ago

Closed 12 months ago

#13485 closed defect (fixed)

FriBiDi: Error when compiling because some symbols are not allowed.

Reported by: carlo-bramini Owned by: sev-
Priority: normal Component: Common
Version: Keywords: fribidi
Cc: Game:

Description

When compiling SCUMMVM, I got this error:

    C++      common/unicode-bidi.o
In file included from /usr/include/glib-2.0/glib/gtypes.h:35,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/fribidi/fribidi-common.h:61,
                 from /usr/include/fribidi/fribidi.h:35,
                 from ../scummvm/common/unicode-bidi.cpp:27:
/usr/include/time.h:56:23: error: macro "clock" passed 1 arguments, but takes just 0
   56 | clock_t    clock (void);
      |                       ^
In file included from ../scummvm/common/scummsys.h:487,
                 from ../scummvm/common/ustr.h:25,
                 from ../scummvm/common/unicode-bidi.cpp:22:
../scummvm/common/forbidden.h:250: note: macro "clock" defined here
  250 |         #define clock() FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |
In file included from ../scummvm/common/scummsys.h:487,
                 from ../scummvm/common/ustr.h:25,
                 from ../scummvm/common/unicode-bidi.cpp:22:
../scummvm/common/forbidden.h:260:84: error: expected initializer before ‘SYMBOL’
  260 |         #define difftime(a,b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                                    ^~~~~~
../scummvm/common/forbidden.h:280:84: error: expected initializer before ‘SYMBOL’
  280 |         #define mktime(a)       FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                                    ^~~~~~
../scummvm/common/forbidden.h:285:76: error: expected initializer before ‘SYMBOL’
  285 |         #define time(a) FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                            ^~~~~~
../scummvm/common/forbidden.h:245:84: error: expected initializer before ‘SYMBOL’
  245 |         #define asctime(a)      FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                                    ^~~~~~
../scummvm/common/forbidden.h:255:84: error: expected initializer before ‘SYMBOL’
  255 |         #define ctime(a)        FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                                    ^~~~~~
../scummvm/common/forbidden.h:270:84: error: expected initializer before ‘SYMBOL’
  270 |         #define gmtime(a)       FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                                    ^~~~~~
../scummvm/common/forbidden.h:275:84: error: expected initializer before ‘SYMBOL’
  275 |         #define localtime(a)    FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
      |                                                                                    ^~~~~~
../scummvm/common/unicode-bidi.cpp: In member function ‘void Common::UnicodeBiDiText::initWithU32String(const Common::U32String&)’:
../scummvm/common/unicode-bidi.cpp:86:29: warning: ‘FriBidiLevel fribidi_log2vis(const FriBidiChar*, FriBidiStrIndex, FriBidiParType*, FriBidiChar*, FriBidiStrIndex*, FriBidiStrIndex*, FriBidiLevel*)’ is deprecated [-Wdeprecated-declarations]
   86 |         if (!fribidi_log2vis(
      |                             ^
In file included from /usr/include/fribidi/fribidi.h:35,
                 from ../scummvm/common/unicode-bidi.cpp:27:
/usr/include/fribidi/fribidi-deprecated.h:198:33: note: declared here
  198 |      FRIBIDI_ENTRY FriBidiLevel fribidi_log2vis (
      |                                 ^~~~~~~~~~~~~~~
make: *** [../scummvm/Makefile.common:171: common/unicode-bidi.o] Error 1

It seems that adding this line on top of the file has solved the issue:

#define FORBIDDEN_SYMBOL_ALLOW_ALL

If you think that it is a good change, I can do a PR on GITHUB.

Sincerely.

Change History (2)

comment:1 by aquadran, 2 years ago

Summary: FriBiDi: Error when compining because some symbols are not allowed.FriBiDi: Error when compiling because some symbols are not allowed.

comment:2 by sev-, 12 months ago

Owner: set to sev-
Resolution: fixed
Status: newclosed

Fixed

Note: See TracTickets for help on using tickets.