Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stubbing out function 1

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
US
Hello. I am trying to stub out a command that is used for a Sharc board using visual DSP. Being familiar with these two products is probably not necessary to know the answer to my question (if possible). For memory mapping a

section("<some memory segment>")

command is used. This command is used outside of any functions (where you would put global variables of file scope). I am writing a simulation in C on the Windows side (not embedded) that cannot understand this command and I was wondering if anyone knew a way in which I would be able to "stub out" this command. I want the simulation to use the code which is constantly updating, so simply commenting out the section commands is not very efficient. An example of what I am trying to do is..


<somefile.c>
section("seg_dmco") <-note no semi colon used on command

void somefunc(void)
{
<some processing>
};

//below is .c file which is in scope of the above file

<stuboutprogram.c>
#define section(x) void stub(x)

void stub(char* arParam)
{
};


The above does not work since
1. the section command is not called within a function.
2. On top of 1, there is no semi colon on the command.

Any brainstorming ideas would be greatly appreciated.
 
Code:
#define section(x)
Should be enough to get rid of
section("seg_dmco")

--
 
That does work, thank you Salem. That was easy enough haha.

Also if anyone was paying attention to my post, the no semi colon issue(issue #2) that I mentioned, is not an issue the semi colon is not needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top