Greg Parker escreveu:
I'd rewrite it like this:
-- main.c -- #include "morecode.h" myvar = getvar();
-- morecode.h -- Int16 getvar() EXTRA;
-- morecode.c -- #include "morecode.h" Int16 getvar() { ... }
This way all code uses the same annotated prototype.
Hi,
I am trying to migrate to a multi-segment a standard 68k C++ project at PODS 1.1 and I have a doubt:
As I am using c++ and 99% of my functions are class members, is possible to define a entire class inside a segment in a simple way like this example below?
-- main.c -- #include "MyClass.h"
myObject* MyClass; myObject= new MyClass();
myObject->myFunc();
-- MyClass.h -- #include "Sections.h"
class MyClass EXTRA_SEGMENT_ONE; //<-- Here I am attempting to put the entire class inside segment 1,
class MyClass {
public:
MyClass();
~MyClass();
void myFunc(void);
}-- MyClass.cpp --
#include "MyClass.h"
MyClass::MyClass(){...}void MyClass::myFunc(void){...}It do compiles correctly, but I am still getting the "region coderes" error thing when linking:
/usr/m68k-palmos/bin/ld: region coderes is full (Debug/MagicLogic section .text) /usr/m68k-palmos/lib/crt0.o(.text+0x50): In function `start': crt0.c:64: relocation truncated to fit: DISP16 __do_bhook /usr/m68k-palmos/lib/crt0.o(.text+0x5a):crt0.c:67: relocation truncated to fit: DISP16 __do_ctors /usr/m68k-palmos/lib/crt0.o(.text+0x70):crt0.c:72: relocation truncated to fit: DISP16 __do_dtors
I don't know if the declaration:
class MyClass EXTRA_SEGMENT_ONE;
is directing correctly the entire class code inside EXTRA_SEGMENT_ONE segment or letting the myFunc to default segment.
1) Anyone already tried this kind of class syntax for multi-segment (for classes and not functions)?
2) Is possible to exam the Myclass.o obj or other output stuff and check in which segment it is?
Thanks
Erico Franco - visit our PalmOS forums at http://forums.micromagiclabs.com
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
