Home » Developing U++ » U++ Developers corner » A new way how to create "plugin"
A new way how to create "plugin" [message #6588] |
Sun, 19 November 2006 18:38 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
While solving a problem with linux having png.so library, I have found an interesting way how to integrate external libraries into U++ ("plugin").
Instead of putting everything into the package, I have created "pnglib.c" file with
#include "lib/png.c"
#include "lib/pngerror.c"
#include "lib/pnggccrd.c"
#include "lib/pngget.c"
#include "lib/pngmem.c"
#include "lib/pngpread.c"
#include "lib/pngread.c"
#include "lib/pngrio.c"
#include "lib/pngrtran.c"
#include "lib/pngrutil.c"
#include "lib/pngset.c"
#include "lib/pngtrans.c"
#include "lib/pngvcrd.c"
#include "lib/pngwio.c"
#include "lib/pngwrite.c"
#include "lib/pngwtran.c"
#include "lib/pngwutil.c"
There are two advantages - it will get compiled faster (actually this is sort of BLITZ - normally BLITZ is not active for C files).
Another advantage is that I can #ifdef this chunk - which I need at the moment to supress inclusion of sources in Linux (to link .so).
Disadvantage is that all headers included by these library files must have include-once-guards, so this is not applicable in all cases...
Mirek
|
|
|
Goto Forum:
Current Time: Mon May 06 02:33:06 CEST 2024
Total time taken to generate the page: 0.02486 seconds
|