Author Topic: Single PCH file for building the CodeBlocks_wx31_64.cbp  (Read 4150 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Single PCH file for building the CodeBlocks_wx31_64.cbp
« on: November 28, 2020, 09:47:38 am »
Several years ago, I posted some patches to build CodeBlocks_wx30.cbp which only need to use single PCH, also, we don't need to export unnecessary symbols from the codeblocks.dll. Now those patches are manually applied to the CodeBlocks_wx31_64.cbp and related files.

You can find it here: https://github.com/asmwarrior/codeblocks_sf/tree/small_codeblocks_dll
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.

Offline LETARTARE

  • Regular
  • ***
  • Posts: 444
  • L'ami de l'homme.The friend of man.
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #1 on: November 28, 2020, 10:10:23 am »
Hello,
what are these fixes?
CB-rev12317, plugins : AddOnForQt-3.3 sdk260
1-Win7 Business Pack1 64bits : wx-3.1.5, gcc-8.1.0,
2-Vista Business Pack2 32bits : wx-3.1.4, gcc-8.1.0
3-OpenSuse-15.2-Leap 64bits : wx-3.03, gcc-7.5.
=> !! The messages are translated by Deepl !!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #2 on: November 28, 2020, 11:46:07 am »
One issue I try to fix is that I don't think it is necessary to export all the symbols  from the codeblocks.dll, only a few of them need to be exported, so this can reduce the size of the codeblocks.dll.

Another issue is: I always see two PCH file generated when building. In-fact, we can use only one PCH file for both building sdk target and other src or plugin targets.

EDIT:

http://forums.codeblocks.org/index.php/topic,20607.msg140408.html#msg140408

This is the old discussion about this issue.
« Last Edit: November 28, 2020, 11:51:29 am 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #3 on: November 28, 2020, 01:11:00 pm »
1. In my opinion this PCH stuff causes more problems than it solves. For me even slows the compilation down, because I edit some of the headers included in it very often. But most of these headers are not used everywhere, but I get a full rebuild anyway. I'll be happy to just remove it. Also full rebuilds are serialized on modern machines, because they are waiting on the 2 pch compilations.
2. Your branch contains other changes.
3. You reuse the DLLIMPORT macro for different libs, don't do it. It will cause problems some day.
4. I'm 25% into the process of removing SqPlus.
5. I'm pretty sure you've broken the --disable-pch autotools build, but I have not tested.
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #4 on: November 28, 2020, 02:03:20 pm »
1. In my opinion this PCH stuff causes more problems than it solves. For me even slows the compilation down, because I edit some of the headers included in it very often. But most of these headers are not used everywhere, but I get a full rebuild anyway. I'll be happy to just remove it. Also full rebuilds are serialized on modern machines, because they are waiting on the 2 pch compilations.
2. Your branch contains other changes.

My branch has manily two things:
1, PCH related changes, from your point, non-pch build is better, so, we can drop the PCH related changes.
2, some export related changes, I think we don't need to export every symbols from the codeblocks.dll, which makes the codeblocks.dll smaller.

Quote
3. You reuse the DLLIMPORT macro for different libs, don't do it. It will cause problems some day.
which commit?

Quote
4. I'm 25% into the process of removing SqPlus.
I don't know SqPlus' relatationship with my branch.

Quote
5. I'm pretty sure you've broken the --disable-pch autotools build, but I have not tested.
I have only Windows build system, so, I can't test it.
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #5 on: November 28, 2020, 02:05:26 pm »
About the visibility issue, for example:

- export cbSmartIndentPlugin class from the codeblocks.dll · asmwarrior/[email protected]https://github.com/asmwarrior/codeblocks_sf/commit/8259e0c0a4271aecda50b3a3f22c2b5ae96a8f9a

I think this change is needed either we enable PCH or disable PCH.

EDIT:

Since we build the codeblocks.dll as a shared library, and this dll include all the tinyxml source code, I add export decorations in tinyxml header files. (Which is suggested in this post: TinyXML / Discussion / Developer: TinyXML shared lib)
« Last Edit: November 28, 2020, 03:55:14 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #6 on: November 28, 2020, 04:15:34 pm »
1. Are PCH changes related to the visibility changes? Or in other words: can we fix the PCH without forcing visibility and vice versa?
2. Your branch: has the patch to re-enable the symbol browser and another patch to fix some hidpi issue.
3. The one which adds tinyxml DLLIMPORT to tinyxml. Use prefix marcos for different libs.
4. The major blocker for fixing the visibility was sqplus and its use in plugins. You're changing SqPlus to export stuff, so it is related.
5. You'll either have to setup a vm and test it there or ask someone to do this for you.
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #7 on: November 29, 2020, 05:07:59 am »
1. Are PCH changes related to the visibility changes? Or in other words: can we fix the PCH without forcing visibility and vice versa?
NO, PCH issue and visibility issue are independent.

Basically, I think visibility is about to reduce the codeblocks.dll's size, currently when building this dll, we use a "-Wl,--export-all-symbols" option. I think we don't need to use this option, we can only export the symbols we needed, so we need add some "__declspec(dllexport)" decoration to the symbols.


PCH issue is mainly about the building speed, this has lower priority as I think.
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #8 on: November 29, 2020, 05:55:49 am »
3. The one which adds tinyxml DLLIMPORT to tinyxml. Use prefix marcos for different libs.
you mean the name "DLLIMPORT" is not good, I may change a another name like "TINYXMLIMPORT"?

Quote
4. The major blocker for fixing the visibility was sqplus and its use in plugins. You're changing SqPlus to export stuff, so it is related.
By default, the SqPlus export all the symbols, this is done by the linker option  "-Wl,--export-all-symbols" when building the codeblocks.dll.
Code
 src/include/scripting/include/squirrel.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/include/scripting/include/squirrel.h b/src/include/scripting/include/squirrel.h
index 9b1b6e9c9..7375b3860 100644
--- a/src/include/scripting/include/squirrel.h
+++ b/src/include/scripting/include/squirrel.h
@@ -36,8 +36,14 @@ extern "C" {
 #endif
 
 #ifndef SQUIRREL_API
-#define SQUIRREL_API extern
-#endif
+#ifdef _WIN32
+    // since we build the squirrel static library, and we need to export all the symbols
+    // the codeblocks.dll, we need to add the dllexport decoration
+    #define SQUIRREL_API extern __declspec(dllexport)
+#else
+    #define SQUIRREL_API extern
+#endif // _WIN32
+#endif // SQUIRREL_API
 
 #if (defined(_WIN64) || defined(_LP64))
 #ifndef _SQ64

What I change here is that those SqPlus symbols are explicitly exported(since I remove the "-Wl,--export-all-symbols"), so the final exported symbols of SqPlus in codeblocks.dll are not changed after my changes.

« Last Edit: November 29, 2020, 06:02:37 am 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7102
    • My Best Post
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #9 on: November 29, 2020, 07:27:39 am »
WARNING: You must include the PCH file under windows directly!
You can not just include a header that includes the PCH file and expect it to work.

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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #10 on: November 29, 2020, 11:51:54 am »
WARNING: You must include the PCH file under windows directly!
You can not just include a header that includes the PCH file and expect it to work.

Tim S.

Hi, tim, I know this, and my solution is to explicitly include this pch file in the command line, for example, when build the "src" target, it has such command line


Quote
g++.exe -Wall -g -pipe -mthreads -m64 -fmessage-length=0 -fexceptions -Winvalid-pch -std=gnu++11 -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DwxUSE_UNICODE -D_WIN64 -DCB_PRECOMP -include "sdk_precomp.h" -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs31_64\include -I.objs31_64\include -I. -IE:\code\wxWidgets-3.1.4\include -IE:\code\wxWidgets-3.1.4\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iexchndl\win64\include -c D:\code\cb\codeblocks_sf_smalldll\src\src\main.cpp -o .objs31_64\src\main.o

You see, the "-include "sdk_precomp.h" command line option, this header file(and in-fact the .gch PCH file) will always be included in the first place.

The trick here is: you should have the SAME c preprocessor definition set when we build the sdk(the sdk_precomp.h PCH file) and the src/plugins target.
« Last Edit: November 29, 2020, 11:54:47 am 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #11 on: November 29, 2020, 04:39:44 pm »
Trick question: Do you get a build time decrease if you use a pch? How much is it? Is it worth it (for me it isn't)?
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7102
    • My Best Post
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #12 on: November 29, 2020, 10:11:12 pm »
Trick question: Do you get a build time decrease if you use a pch? How much is it? Is it worth it (for me it isn't)?

I just tried adding PCH to an open source small project and I got a speed up doing all the things to speed up building except on using an PCH it actually slowed down the building. (Removing unneeded includes from headers and adding forward declares instead)

NOTE: I do have changes to Code::Blocks that speed up the building using an smaller set of includes inside the two PCH files used by CB.

But, I think that removing the use of PCH by all the contrib plugins is likely much easier than getting and maintaining the CB contrib project to build correctly using PCH.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #13 on: November 30, 2020, 02:00:45 am »
Trick question: Do you get a build time decrease if you use a pch? How much is it? Is it worth it (for me it isn't)?

I just did a test of rebuilding CodeBlocks_wx31_64.cbp. (windows 7 64bit, mingw-w64's gcc 8.1)

I have two working tree, folder A is the master(https://github.com/asmwarrior/codeblocks_sf/tree/master),  folder B is the the single pch branch (https://github.com/asmwarrior/codeblocks_sf/tree/small_codeblocks_dll).

The building time is: (I first rebuild A, then rebuild B)

A: 8min 19sec
B: 4min 45sec

After those steps, I try to do rebuild A again, and the time is 8min 15 sec.

So, my conclusion is: we can save about 50% time;)





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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #14 on: November 30, 2020, 09:18:05 pm »
No this is not how you benchmark. Apply all changes in your branch, then try to measure PCH-on versus PCH-off.
Currently you're measuring noPCH+massive amount of symbols and PCH+smaller amount of symbols. The linking step in C::B is serial, so it has big effects on the overall time. Smaller number of symbols improves linking performance.
Also what happens if you just put only wx related includes in the PCH or you use the wxprec.h or whatever is called?

p.s. My build time on Linux, GCC 9.3.0, Amd Ryzen7 1700 (relatively slow CPU in 2020, it is slower than a mobile cpu produced by a fashion/fruit company) is:
1. 93 sec with PCH.
2. 123 sec without PCH.

So, you need to buy better CPU and/or switch to better compiler. GCC on windows is massively slow. So working to switch to something like clang would be a big improvement in both speed and compiler quality (GCC on windows is pretty bad compared to how it behaves on Linux). I've not use clang on windows, but I doubt it would be as bad as GCC is. On linux clang and GCC are comparable.

And I pay 60 seconds or more every time I edit a header which is in the PCH, super annoying.

p.p.s. The compilation is really slow if the compiler emits too many errors/warnings. If you're not error/warning free you'll get horrendous build times. This is something which needs to be investigated quite a bit.
p.p.p.s. The compilation is non-optimal (and it will get worse on newer non-fruit cpus), because it cannot schedule work from multiple projects. Linking is blocking progress :(. This is clearly visible when building any plugins. Someday I'll write a ninja-build generator, but there are more important projects/problems first.
p.p.p.p.s. The switch from wx28 to wx30 made compilation visibly slower. I've not debugged why, but my guess is the use of basic_string as the base for wxString.
(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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #15 on: November 30, 2020, 09:25:04 pm »
BTW: Don't get me wrong. I'm not opposing the visibility related changes. They are good and important!
I just don't like PCHs and I think they are stupid and a waste of time. :)

Do you get improvement when loading C::B? It should improve load performance, because the dynamic library loader has less work to do when loading DLLs with smaller number of symbols. At least on linux this is pretty slow step.

I don't know if the windows toolchain supports the gc-sections linker option (you need to use -fdata-sections and -ffunction-sections for the compiler for this to work). This leads to smaller .exe and .dll files when using hidden visibility at least on linux. My knowledge about windows related stuff is quite limited these days. :)
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #16 on: December 01, 2020, 03:33:19 pm »
No this is not how you benchmark. Apply all changes in your branch, then try to measure PCH-on versus PCH-off.
Currently you're measuring noPCH+massive amount of symbols and PCH+smaller amount of symbols. The linking step in C::B is serial, so it has big effects on the overall time. Smaller number of symbols improves linking performance.
OK, I see. I may need to create a new branches, and cherry pick some commits to compare the PCH-on vs PCH-off issue.

Quote
Also what happens if you just put only wx related includes in the PCH or you use the wxprec.h or whatever is called?
How can I do it, I need to first build/compile the wx.h file to a gch file?
Quote
p.s. My build time on Linux, GCC 9.3.0, Amd Ryzen7 1700 (relatively slow CPU in 2020, it is slower than a mobile cpu produced by a fashion/fruit company) is:
1. 93 sec with PCH.
2. 123 sec without PCH.
You computer is strong! I'm using an old PC which I bought in 2016.

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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #17 on: December 01, 2020, 04:29:13 pm »
OK, I see. I may need to create a new branches, and cherry pick some commits to compare the PCH-on vs PCH-off issue.
You don't need to do this. Just build from your branch, this would give you the PCH build time. After that disable compiling of the two pch files and change CB_PRECOMP to something else in the project settings. This would give you the noPCH build time.

How can I do it, I need to first build/compile the wx.h file to a gch file?
No idea... Probably the build of wx already provides it. The other option is to remove all non-wx headers from the sdk.h and sdk_precomp.h.

You computer is strong! I'm using an old PC which I bought in 2016.
Actually it is really slow in 2020. As I've said the fruit company has a mobile processor which is faster than it. :)
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7102
    • My Best Post
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #18 on: December 01, 2020, 06:34:34 pm »
OK, I see. I may need to create a new branches, and cherry pick some commits to compare the PCH-on vs PCH-off issue.
You don't need to do this. Just build from your branch, this would give you the PCH build time. After that disable compiling of the two pch files and change CB_PRECOMP to something else in the project settings. This would give you the noPCH build time.

How can I do it, I need to first build/compile the wx.h file to a gch file?
No idea... Probably the build of wx already provides it. The other option is to remove all non-wx headers from the sdk.h and sdk_precomp.h.

You computer is strong! I'm using an old PC which I bought in 2016.
Actually it is really slow in 2020. As I've said the fruit company has a mobile processor which is faster than it. :)

I find that changing "CB_PRECOMP" to "NOPCH" and disable compiling of PCH headers (remember to delete the PCH gch files if they exists) works okay for me.

Edit: Remember to remove the compiler "--include" command in your case.

Tim S.
« Last Edit: December 01, 2020, 06:44:09 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #19 on: December 04, 2020, 12:27:11 am »
...

I find that changing "CB_PRECOMP" to "NOPCH" and disable compiling of PCH headers (remember to delete the PCH gch files if they exists) works okay for me.

Edit: Remember to remove the compiler "--include" command in your case.

Tim S.

I just did it, and the build time is:

Code
Process terminated with status 0 (8 minute(s), 44 second(s))
0 error(s), 22 warning(s) (8 minute(s), 44 second(s))

So, the "NOPCH" build time is just the same as the standard "two PCH files" build time. :)
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #20 on: December 04, 2020, 04:00:55 am »
I have check the exported symbol in the codeblocks.dll

With my changes to the visibility, the generated codeblocks.dll is about 6.2M, and the export symbol number is 3830.

Without my changes to the visibility, the dll size is about 8.2M, and the export symbol number is 28043.

This, this indeed shows some improvement :)
« Last Edit: December 04, 2020, 06:10:48 am 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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #21 on: December 14, 2020, 02:22:20 am »
I am planning to push the visibility related commits, not pch related commits, any objections?
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #22 on: December 14, 2020, 12:40:11 pm »
Can you please make a branch based on master with the commits you want to push, so I can take a look?
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #23 on: December 14, 2020, 04:57:17 pm »
Can you please make a branch based on master with the commits you want to push, so I can take a look?

OK, I have created a new clean branch, see here:
https://github.com/asmwarrior/codeblocks_sf/tree/visibility2020
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #24 on: December 15, 2020, 01:06:41 am »
In fact can you start a pull request, so we can do a discussion there?
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #25 on: December 15, 2020, 01:19:28 am »
In fact can you start a pull request, so we can do a discussion there?

Done.

https://github.com/obfuscated/codeblocks_sf/pull/15
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #26 on: December 22, 2020, 07:27:13 pm »
I've posted some comments on it.

It seems to build fine 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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #27 on: December 23, 2020, 06:45:45 am »
I've posted some comments on it.

It seems to build fine on Linux.

I make some fix, and do a rebase, and I see the pull request get updated.

BTW: there are too many "extern" keywords already in our code base for global functions.
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #28 on: December 23, 2020, 10:38:17 am »
Yes, I know, just don't add new ones. :)
(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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13210
    • Travis build status
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #29 on: December 23, 2020, 10:40:13 am »
And please don't do any more rebases. I'm really confused what happened.  :o
(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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5339
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Single PCH file for building the CodeBlocks_wx31_64.cbp
« Reply #30 on: December 24, 2020, 03:51:39 pm »
FYI: I committed all the visibility related patches to our svn trunk now.
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.