Hi Reinfried,

Create two new files handler.h and handler.c.

Put all the functions you have annotated with the HANDLER_SECTION macro in
handler.c.

In handler.h put prototypes for each of the HANDLER_SECTION functions.

handler.h should look as the following example

/*----------------------------*/
#ifndef HANDLER_H
#define HANDLER_H


#define SECTION(s) __attribute__ ((section (s)))

#define SECTION_HANDLER SECTION("code3")

void DisplayDateTime(DateTimeType * dtP)
SECTION_HANDLER;

(only put here those functions explicitly called by your main file
(optional))

#endif
/*----------------------------*/

handler.c should looks as follows

/*----------------------------*/

#include "handler.h"

void SECTION_HANDLER
DisplayDateTime(DateTimeType * dtP)
{

/* function code */

}

(your other functions removed from your main file.  Optionally put static in
front of those
functions not directly called from your main file.)

/*----------------------------*/

Your main c file should have a

#include "handler.h"

line near the start.

Modify your linker to include handler.o as well as your main file .o.

Regards,

p.s. if this still doesn't make sense let me know and I'll prepare a
cut-down project and Makefile for you.


On 01/02/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Pinus,
>
> Perhaps I do not entirely understand the process of splitting the code
> into sections.  Right now, all my code is in one file, ClueHints.c.  That's
> where I define the HANDLER_SECTION macro and where I declare and then define
> all the functions, some of which are now declared with the macro to put them
> in the new handlers section and some of which are not.  You mention
> accessibility from another file, so should I be using a separate .c file to
> do some of this work, or should any of this be in a .h file?  I apologize if
> I sound confused, but I have been using CodeWarrior for a long time before
> trying to do this port.  I tried removing the static label from the form
> handlers' function declarations and definitions within ClueHints.c (I
> didn't remove it from the other functions I intended to leave in the main
> section - should I?), but I got the same errors.  Thanks again for your
> help,
>
> Martin
>
>

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to