Author Topic: Proposed CB header file of wxscintilla_cb.h  (Read 5605 times)

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Proposed CB header file of wxscintilla_cb.h
« on: January 24, 2014, 04:21:41 pm »
Propose: Is to include the real header of "sdk/wxscintilla/include/wx/wxscintilla.h"
Reason: The use of  "wx/wxscintilla.h" inside "include/sdk_common.h" requires all Plugins
 that use sdk.h to have the search folder of "sdk/wxscintilla/include" even if they do NOT need "wx/wxscintilla.h".

Problem A: This results in extra search folder being needed.
Problem B: If the search does NOT exist and the PCH of sdk.h does NOT exist it results in error if sdh.h is included in plugin.

I have attached a patch that seems to fix these problem; but, I wish feedback on the idea.

Is this a good fix?
Is there a better fix?

Deleted patch file.

Tim S.
« Last Edit: January 25, 2014, 08:00:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #1 on: January 24, 2014, 06:25:36 pm »
I am testing my fix with these two patches to the Devpak plugin.

The cb_cbp adds the search folder for the PCH without this patch the other one fails with the error can't find wx/wxscintilla.h.

I have NOT yet tested the working of the Devpak plugin.

Tim S.

Added to github https://github.com/stahta01/codeblocks/tree/master/Patches

« Last Edit: January 26, 2014, 05:35:18 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #2 on: January 25, 2014, 03:33:14 pm »
Propose: Is to include the real header of "sdk/wxscintilla/include/wx/wxscintilla.h"
Reason: The use of  "wx/wxscintilla.h" inside "include/sdk_common.h" requires all Plugins
 that use sdk.h to have the search folder of "sdk/wxscintilla/include" even if they do NOT need "wx/wxscintilla.h".

Problem A: This results in extra search folder being needed.
Problem B: If the search does NOT exist and the PCH of sdk.h does NOT exist it results in error if sdh.h is included in plugin.

I have attached a patch that seems to fix these problem; but, I wish feedback on the idea.

Is this a good fix?
Is there a better fix?

Tim S.

Hi, Tim, thanks.
I'm generally Ok with your change.

Another method could be:

Do not create a new header file named "wxscintilla_cb.h", but replace all the text
Code
#include "wx/wxscintilla.h"
with
Code
#include "../sdk/wxscintilla/include/wx/wxscintilla.h"
« Last Edit: January 25, 2014, 04:00:44 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #3 on: January 25, 2014, 07:59:34 pm »
Decided to do your suggestion because it is simpler than my way.

Uploaded patch file to my github.com location.

Edit: Deleted old patch because it would NOT work on Linux

Tim S.
« Last Edit: January 26, 2014, 05:23:54 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #4 on: January 25, 2014, 08:20:38 pm »
Hm, I don't think this will work - there is no sdk folder when the headers get installed in the /usr/include on Linux.
(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!]

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #5 on: January 25, 2014, 09:27:49 pm »
Hm, I don't think this will work - there is no sdk folder when the headers get installed in the /usr/include on Linux.

What is the path it is installed into on Linux?

Is it the same folder as sdk.h?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #6 on: January 25, 2014, 09:32:49 pm »
On my machine:
Code
/usr/include/codeblocks/wxscintilla/include/wx/wxscintilla.h
/usr/include/codeblocks/sdk.h
(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!]

Online stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Proposed CB header file of wxscintilla_cb.h
« Reply #7 on: January 26, 2014, 05:22:32 pm »
Hm, I don't think this will work - there is no sdk folder when the headers get installed in the /usr/include on Linux.

Saved a much larger patch; that will likely need fixes to makefile and cbp files to work.

https://github.com/stahta01/codeblocks/blob/master/Patches/cb_all_include_wxscintilla_cb_h.patch

Edit: Plan to change patch to much smaller patch instead of the above patch.

Tim S.


« Last Edit: February 22, 2014, 03:52:59 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org