Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 is currently offline  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
Previous Topic: What about LUA plugin?
Next Topic: Date emulation for Sqlite
Goto Forum:
  


Current Time: Sun May 05 19:14:40 CEST 2024

Total time taken to generate the page: 0.02088 seconds