I would appreciate getting suggestions on how to approach the following situation.
As mentioned in previous messages to this group, I am porting code from SPARC/Sun_OS/Sun_compilers (development and runtime) to Intel/Solaris_7/GNU_compilers (also development and runtime). Source code are in C, C++, and Pascal. One requirement is to keep the source code so that it can be built in either platforms. I have used #ifdef/#else/#endif with asmname and wrapper functions/ subroutines to handle this.
My problem is with several global variables. For example, I have one called "emulator_error" and it is used in 250 files with around 100 in C and 150 in Pascal source files. Is there a way to avoid editing all 150 Pascal files to put the #ifdef/#else/#endif with asmname directive? I believe writing a script to do this will be complicated since the variable names can be declared in a line where several variables are declared. For example: Var test_val, emulator_error, sum : integer; and only emulator_error is used in both C and Pascal; test_val and sum are referenced in Pascal source code only.
Regards,
Jing Gloria Texas Instruments Sherman, Texas