Author Topic: Scripting update proposal  (Read 5689 times)

Offline comsytec

  • Multiple posting newcomer
  • *
  • Posts: 58
    • www.comsytec.com
Scripting update proposal
« on: April 02, 2014, 02:41:43 pm »
Hello

Can I propose this change in sqplus.h :

from:

Code
// === 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:

Code
// === 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

Code
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

Code
extern template struct ClassType<wxString>;

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Scripting update proposal
« Reply #1 on: April 02, 2014, 06:02:30 pm »
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!]