More on: Help me: how to determine constant value at link time?

Of course I know header file. But my problem is that: I have a lot of C files, who share one Header file, and I made a library. But when I use the library in different projects, I need to modify the parameters, which are defined as MACROs.

So I want to determine these constants' value at linking time. If they are defined as

external code MAX;
external code MIN_VALUE;

Then the source code grows larger, and even worse, some important functions are no longer reentrant-able, because no more registers can be used to pass function paramters.

My library is an operation system based on 51. So you know that reentrant function are import.

I have tries for several months but still fail. It's really a chanllenging problem, and it's every useful for building a library whose parameters can be configured in an ASM file.

Can any one have a solution?

Parents Reply Children
More questions in this forum