Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

SqPlus modifications

Last post 01-12-2008, 12:36 PM by ats. 32 replies.
Page 3 of 3 (33 items)   < Previous 1 2 3
Sort Posts: Previous Next
  •  01-12-2008, 8:09 AM 2339 in reply to 2338

    Re: SqPlus modifications

    Hello,

    Things like this can be a bit tricky. I think you have to do some tests to zoom in on the error.

    Looking at the macros DECLARE_INSTANCE_TYPE_NAME in sqplus.h and SqPlusConst.h they do look correct to me and define the functions the linker looks for.

    There seems to be one difference:

    sqplus.h:

    // Ordinary case
    #define DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) namespace SqPlus { \
      DECLARE_INSTANCE_TYPE_BASE_(TYPE,NAME) \
      template<> inline void Push(HSQUIRRELVM v,TYPE * value) { \

    SqPlusConst.h:

    #define DECLARE_INSTANCE_TYPE_NAME_CONST(TYPE,NAME) \
    DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) \
    namespace SqPlus { \
    DECLARE_INSTANCE_TYPE_NAME_CONST_BASE(TYPE,NAME) \
    inline void Push(HSQUIRRELVM v,const TYPE * value) { \


    There is a missing template<> in SqPlusConst.h. Maybe this? (GCC can be difficult here).

    Some other useful things to do is:
    1 - Insert #warning statements into macros
    2 - Expand the macro manually into the source code file

    Let me know how this goes.

    Regards
    // ATS


  •  01-12-2008, 10:45 AM 2340 in reply to 2339

    Re: SqPlus modifications

    Hi.

    Thank you for your quick answer and also for your very useful answer. I don't really understand what you want me to do with the #warning statement and I already had tested to expand the macro manually and it didn't work.

    Anyway, it seems you spotted the error: adding "template<>" before the two "inline void Push" seems to do the trick. I could do a patch for this but I think you should be able to easily correct it without patch. I don't know if there are other missing template<> as it seems to work now (I guess other pushes miss it in that file).

    Thank you,
    Sebastien
  •  01-12-2008, 12:36 PM 2341 in reply to 2340

    Re: SqPlus modifications

    Good to hear it worked.

    I'll try to submit it to SVN.

    With #warning test I meant something like:

    // Ordinary case
    #define DECLARE_INSTANCE_TYPE_NAME_(TYPE,NAME) namespace SqPlus { \
      #warning I'm being compiled! \
      DECLARE_INSTANCE_TYPE_BASE_(TYPE,NAME) \
      template<> inline void Push(HSQUIRRELVM v,TYPE * value) {

    Useful when not knowing if something is included or not.

    Regards
    // ATS
Page 3 of 3 (33 items)   < Previous 1 2 3
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems