0

I'm trying to compile some c-code that was originally written for SDCC using GCC to run some unit tests on a host computer. There are some language extensions for SDCC like __xdata or __pdata (for memory control) which should remain for SDCC but that should be ignored when compiled with GCC. I would strongly prefer not to modify the modules under test. Is there any way to do this?

I already figured out that it works if I add something like #define __xdata in the module under test. Maybe it is possible to have something like a "global definition" therefore? I have little experience with the GCC. Maybe there are compiler flags that could help me?

Imael
  • 1
  • 1

1 Answers1

0

There are two compiler flags, you could use:

  • -include allows you to give a c file that is additionally included and do the defines in that file.
  • Define macros via command line options -D__xdata=
basxto
  • 63
  • 1
  • 5