Csound Csound-dev Csound-tekno Search About

[Cs-dev] Pragmas for exporting symbols

Date2006-10-17 05:22
FromAnthony Kozar
Subject[Cs-dev] Pragmas for exporting symbols
I have added OS 9 pragmas for exporting all of the functions marked PUBLIC.
(Previously I had been maintaining the export list by hand but this was very
tedious and error-prone).

For this scheme to work, it requires that the pragmas be maintained in the
proper places in the files csound.h, cscore.h, and cfgvar.h.  One pragma
turns on symbol exportation and comes before all of the function
declarations in the file and the other turns it off and comes at the end.

If anyone adds any new PUBLIC functions in the future, kindly make sure that
you add them in between these two lines (only the function prototypes need
be surrounded this way).  If new PUBLIC functions are added to a file other
than these three, then the pragmas will need to be added to that file as
well.

I will try to keep an eye on this but mistakes could creep in ...

THANKS :)

Anthony Kozar
anthonykozar AT sbcglobal DOT net

/* This pragma must come before all public function declarations */
#if (defined(macintosh) && defined(__MWERKS__))
#  pragma export on
#endif

/* This pragma must come after all public function declarations */
#if (defined(macintosh) && defined(__MWERKS__))
#  pragma export off
#endif


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-10-17 05:36
Frommatt ingalls
SubjectRe: [Cs-dev] Pragmas for exporting symbols
especially since OS9 AND mwerks are pretty much dead
wouldn't it be better to use an .exp file instead?

On Oct 16, 2006, at 9:22 PM, Anthony Kozar wrote:

> I have added OS 9 pragmas for exporting all of the functions marked  
> PUBLIC.
> (Previously I had been maintaining the export list by hand but this  
> was very
> tedious and error-prone).
>
> For this scheme to work, it requires that the pragmas be maintained  
> in the
> proper places in the files csound.h, cscore.h, and cfgvar.h.  One  
> pragma
> turns on symbol exportation and comes before all of the function
> declarations in the file and the other turns it off and comes at  
> the end.
>
> If anyone adds any new PUBLIC functions in the future, kindly make  
> sure that
> you add them in between these two lines (only the function  
> prototypes need
> be surrounded this way).  If new PUBLIC functions are added to a  
> file other
> than these three, then the pragmas will need to be added to that  
> file as
> well.
>
> I will try to keep an eye on this but mistakes could creep in ...
>
> THANKS :)
>
> Anthony Kozar
> anthonykozar AT sbcglobal DOT net
>
> /* This pragma must come before all public function declarations */
> #if (defined(macintosh) && defined(__MWERKS__))
> #  pragma export on
> #endif
>
> /* This pragma must come after all public function declarations */
> #if (defined(macintosh) && defined(__MWERKS__))
> #  pragma export off
> #endif
>
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-10-17 06:02
FromAnthony Kozar
SubjectRe: [Cs-dev] Pragmas for exporting symbols
That is what I was doing (and am continuing to do for plugins).  However, it
was extremely difficult to be sure that the export file was always
up-to-date (1), especially when people would add or remove API functions
without announcing them on the mailing list or even noting the changes in
the ChangeLog.

When Csound 5.00 was released, there were more than a dozen mistakes in my
export list because of this.  I think using the pragmas will be far better
and I doubt that it will present a burden to anyone since they are clearly
labeled near the beginnings and ends of the mentioned files.

(1)  and tedious!  I would have to search for the word PUBLIC which returns
over 400 results, I think, and then copy and paste the names of the
functions by hand.

Anthony Kozar
anthonykozar AT sbcglobal DOT net


matt ingalls wrote on 10/17/06 12:36 AM:

> especially since OS9 AND mwerks are pretty much dead
> wouldn't it be better to use an .exp file instead?


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net