News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Scripting update proposal

Started by comsytec, April 02, 2014, 02:41:43 PM

Previous topic - Next topic

comsytec

Hello

Can I propose this change in sqplus.h :

from:

// === Class Type Helper class: returns a unique number for each class type ===

template<typename T>
struct ClassType {
  static SQUserPointer type(void) { return (SQUserPointer)&copy; }
  static CopyVarFunc getCopyFunc(void) { return (CopyVarFunc)&copy; }
  static void copy(T * dst,T * src) {
    *dst = *src;
  } // copy
};


to:

// === Class Type Helper class: returns a unique number for each class type ===

template<typename T>
struct ClassType {
  static SQUserPointer type(void) __attribute__((noinline,noclone)) { return (SQUserPointer)&copy; }
  static CopyVarFunc getCopyFunc(void) __attribute__((noinline,noclone)) { return (CopyVarFunc)&copy; }
  static void copy(T * dst,T * src) __attribute__((noinline,noclone)) { *dst = *src; } // copy
};


Without it e.g. wxString instance assignment made through script calls introduced outside scripted wizard cause

INSTANCE type assignment mismatch

error in running script for release version "-O2" compiled where the compiler optimized out mentioned methods from SDK DLL

The e.g. wxString must be referred then with

extern template struct ClassType<wxString>;

in code (plugin) introducing new script features to prevent error mentioned above.

oBFusCATed

Please provide a patch in a proper form: http://wiki.codeblocks.org/index.php?title=Creating_a_patch_to_submit_to_BerliOS_%28Patch_Tracker%29

Also it would be helpful if you provide the exact steps needed to reproduce the problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]