Advertisement

defining AS_NO_CLASS_METHODS causes compilation errors

Started by September 02, 2023 02:14 PM
5 comments, last by WitchLord 1 year, 2 months ago

if I define AS_NO_CLASS_METHODS in as_config.h the library fails to compile

Thanks for letting me know of this problem. I'll have it fixed as soon as possible.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I've fixed this in revision 2857.

Thanks,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Hello, I still have problems compiling with gcc on Linux. This is the compiler output:

In file included from ../../source/as_config.h:1432,
                 from ../../source/as_scriptengine.cpp:41:
../../source/../include/angelscript.h: In constructor ‘asSFuncPtr::asSFuncPtr(asBYTE)’:
../../source/../include/angelscript.h:504:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
  504 |                 for( int n = 0; n < sizeof(ptr.dummy); n++ )
      |                                 ~~^~~~~~~~~~~~~~~~~~~
../../source/as_scriptengine.cpp: In member function ‘void asCScriptEngine::CallObjectMethod(void*, asSSystemFunctionInterface*, asCScriptFunction*) const’:
../../source/as_scriptengine.cpp:4172:25: error: ‘asSIMPLEMETHOD_t’ does not name a type
 4172 |                         asSIMPLEMETHOD_t mthd;
      |                         ^~~~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4186:23: error: ‘asCSimpleDummy’ was not declared in this scope
 4186 |                 void (asCSimpleDummy::*f)() = p.mthd;
      |                       ^~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4186:49: error: ‘union asCScriptEngine::CallObjectMethod(void*, asSSystemFunctionInterface*, asCScriptFunction*) const::<unnamed>’ has no member named ‘mthd’
 4186 |                 void (asCSimpleDummy::*f)() = p.mthd;
      |                                                 ^~~~
../../source/as_scriptengine.cpp:4187:35: error: expected primary-expression before ‘)’ token
 4187 |                 (((asCSimpleDummy*)obj)->*f)();
      |                                   ^
../../source/as_scriptengine.cpp:4187:36: error: expected ‘)’ before ‘obj’
 4187 |                 (((asCSimpleDummy*)obj)->*f)();
      |                  ~                 ^~~
      |                                    )
../../source/as_scriptengine.cpp:4187:47: error: expected ‘)’ before ‘;’ token
 4187 |                 (((asCSimpleDummy*)obj)->*f)();
      |                 ~                             ^
      |                                               )
../../source/as_scriptengine.cpp: In member function ‘bool asCScriptEngine::CallObjectMethodRetBool(void*, int) const’:
../../source/as_scriptengine.cpp:4248:25: error: ‘asSIMPLEMETHOD_t’ does not name a type
 4248 |                         asSIMPLEMETHOD_t mthd;
      |                         ^~~~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4262:23: error: ‘asCSimpleDummy’ was not declared in this scope
 4262 |                 bool (asCSimpleDummy::*f)() = (bool (asCSimpleDummy::*)())(p.mthd);
      |                       ^~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4262:48: error: expected primary-expression before ‘bool’
 4262 |                 bool (asCSimpleDummy::*f)() = (bool (asCSimpleDummy::*)())(p.mthd);
      |                                                ^~~~
../../source/as_scriptengine.cpp:4262:48: error: expected ‘)’ before ‘bool’
 4262 |                 bool (asCSimpleDummy::*f)() = (bool (asCSimpleDummy::*)())(p.mthd);
      |                                               ~^~~~
      |                                                )
../../source/as_scriptengine.cpp:4263:42: error: expected primary-expression before ‘)’ token
 4263 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                                          ^
../../source/as_scriptengine.cpp:4263:43: error: expected ‘)’ before ‘obj’
 4263 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                         ~                 ^~~
      |                                           )
../../source/as_scriptengine.cpp:4263:54: error: expected ‘)’ before ‘;’ token
 4263 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                        ~                             ^
      |                                                      )
../../source/as_scriptengine.cpp: In member function ‘int asCScriptEngine::CallObjectMethodRetInt(void*, int) const’:
../../source/as_scriptengine.cpp:4325:25: error: ‘asSIMPLEMETHOD_t’ does not name a type
 4325 |                         asSIMPLEMETHOD_t mthd;
      |                         ^~~~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4339:22: error: ‘asCSimpleDummy’ was not declared in this scope
 4339 |                 int (asCSimpleDummy::*f)() = (int (asCSimpleDummy::*)())(p.mthd);
      |                      ^~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4339:47: error: expected primary-expression before ‘int’
 4339 |                 int (asCSimpleDummy::*f)() = (int (asCSimpleDummy::*)())(p.mthd);
      |                                               ^~~
../../source/as_scriptengine.cpp:4339:47: error: expected ‘)’ before ‘int’
 4339 |                 int (asCSimpleDummy::*f)() = (int (asCSimpleDummy::*)())(p.mthd);
      |                                              ~^~~
      |                                               )
../../source/as_scriptengine.cpp:4340:42: error: expected primary-expression before ‘)’ token
 4340 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                                          ^
../../source/as_scriptengine.cpp:4340:43: error: expected ‘)’ before ‘obj’
 4340 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                         ~                 ^~~
      |                                           )
../../source/as_scriptengine.cpp:4340:54: error: expected ‘)’ before ‘;’ token
 4340 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                        ~                             ^
      |                                                      )
../../source/as_scriptengine.cpp: In member function ‘void* asCScriptEngine::CallObjectMethodRetPtr(void*, int) const’:
../../source/as_scriptengine.cpp:4402:25: error: ‘asSIMPLEMETHOD_t’ does not name a type
 4402 |                         asSIMPLEMETHOD_t mthd;
      |                         ^~~~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4416:24: error: ‘asCSimpleDummy’ has not been declared
 4416 |                 void *(asCSimpleDummy::*f)() = (void *(asCSimpleDummy::*)())(p.mthd);
      |                        ^~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4416:40: error: expected unqualified-id before ‘*’ token
 4416 |                 void *(asCSimpleDummy::*f)() = (void *(asCSimpleDummy::*)())(p.mthd);
      |                                        ^
../../source/as_scriptengine.cpp:4416:40: error: expected ‘)’ before ‘*’ token
 4416 |                 void *(asCSimpleDummy::*f)() = (void *(asCSimpleDummy::*)())(p.mthd);
      |                       ~                ^
      |                                        )
../../source/as_scriptengine.cpp:4417:27: error: ‘asCSimpleDummy’ was not declared in this scope
 4417 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                           ^~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4417:42: error: expected primary-expression before ‘)’ token
 4417 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                                          ^
../../source/as_scriptengine.cpp:4417:43: error: expected ‘)’ before ‘obj’
 4417 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                         ~                 ^~~
      |                                           )
../../source/as_scriptengine.cpp:4417:54: error: expected ‘)’ before ‘;’ token
 4417 |                 return (((asCSimpleDummy*)obj)->*f)();
      |                        ~                             ^
      |                                                      )
../../source/as_scriptengine.cpp: In member function ‘void asCScriptEngine::CallObjectMethod(void*, void*, asSSystemFunctionInterface*, asCScriptFunction*) const’:
../../source/as_scriptengine.cpp:4612:25: error: ‘asSIMPLEMETHOD_t’ does not name a type
 4612 |                         asSIMPLEMETHOD_t mthd;
      |                         ^~~~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4626:23: error: ‘asCSimpleDummy’ was not declared in this scope
 4626 |                 void (asCSimpleDummy::*f)(void*) = (void (asCSimpleDummy::*)(void*))(p.mthd);
      |                       ^~~~~~~~~~~~~~
../../source/as_scriptengine.cpp:4626:43: error: expected primary-expression before ‘void’
 4626 |                 void (asCSimpleDummy::*f)(void*) = (void (asCSimpleDummy::*)(void*))(p.mthd);
      |                                           ^~~~
../../source/as_scriptengine.cpp:4626:53: error: expected primary-expression before ‘void’
 4626 |                 void (asCSimpleDummy::*f)(void*) = (void (asCSimpleDummy::*)(void*))(p.mthd);
      |                                                     ^~~~
../../source/as_scriptengine.cpp:4626:53: error: expected ‘)’ before ‘void’
 4626 |                 void (asCSimpleDummy::*f)(void*) = (void (asCSimpleDummy::*)(void*))(p.mthd);
      |                                                    ~^~~~
      |                                                     )
../../source/as_scriptengine.cpp:4627:35: error: expected primary-expression before ‘)’ token
 4627 |                 (((asCSimpleDummy*)obj)->*f)(param);
      |                                   ^
../../source/as_scriptengine.cpp:4627:36: error: expected ‘)’ before ‘obj’
 4627 |                 (((asCSimpleDummy*)obj)->*f)(param);
      |                  ~                 ^~~
      |                                    )
../../source/as_scriptengine.cpp:4627:52: error: expected ‘)’ before ‘;’ token
 4627 |                 (((asCSimpleDummy*)obj)->*f)(param);
      |                 ~                                  ^
      |                                                    )
make: *** [Makefile:168: obj/as_scriptengine.o] Error 1

@WitchLord

Oh, I'm sorry. I didn't test on Linux.

I'll have it fixed too.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this now in rev 2866.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement