Silverfrost Forums

Welcome to our forums

DEFINE'd symbols in SCC

21 Jan 2021 5:32 #26947

I am trying to control the compilation of a set of 'C' routines, and would need to know if the compilation is for 32 or 64 bit.

Is there any global #define symbols that indicate what memory model is being compiled? I have not had success finding any for SCC. If they are the same for FTN95, I can use what you've already provided.

Bill

22 Jan 2021 9:28 #26953

Yes. 64BIT is automatically defined when /64 is used on the SCC command line.

22 Jan 2021 4:15 #26955

This is interesting, I was searching for something like this, too. Are there other preprocesor symbols for scc (32 bit or 64 bit), and if so where would I find information/documentation concerning this?

Regards, Dietmar

22 Jan 2021 8:53 #26960

Dietmar

The is no documentation on this subject.

Here are some symbols that are available:

WINDOWS COMPILE_TIME COMPILER_VERSION WIN64 __cplusplus

WINDOWS means /windows on the command line. WIN64 means /64 on the command line. __cplusplus means C++ mode rather than C mode. COMPILE_TIME and COMPILER_VERSION are as expected but off-hand I don't recall how to use these.

27 Jan 2021 11:32 #26975

Paul,

thanks for the symbols 😃

Concerning the symbols COMPILE_TIME and COMPILER_VERSION you might want to have a look at the program code following:

#include <stdio.h>

int main() {
#ifdef __64BIT__ 
      printf('Is 64 bit\n');
#else
      printf('Is 32 bit\n');
#endif

#ifdef __WINDOWS__
      printf('/windows specified on command line\n');
#else
      printf('/windows not specified on command line\n');
#endif


#ifdef WIN64
      printf('/64 specified on command line\n');
#else
      printf('/64 not specified on command line\n');
#endif

#ifdef __cplusplus
      printf('C++ mode\n');
#else
      printf('C mode\n');
#endif
#ifdef  __COMPILE_TIME__
      printf('Compile time: %s\n',__COMPILE_TIME__);
#else
      printf('__COMPILE_TIME__ undefined\n');
#endif

#ifdef  __COMPILER_VERSION__
      printf('Compiler version: %d\n',__COMPILER_VERSION__);
#else
      printf('__COMPILER_VERSION__ undefined\n');
#endif

}

Execution of the exes generated works as expected with one exception concerning the 64 bit mode when /windows is set. In this case no output is produced. This is different to the 32 bit mode and to the 64 bit mode where /windows is **not **set. ... only for your information, I'm happy with the current state 😃

Regards, Dietmar

27 Jan 2021 11:55 #26976

Dietmar

Thank you for the feedback.

27 Jan 2021 8:00 #26983

Thanks, Paul, this is helpful.

Dietmar, thanks for the code segment. It will be useful, and I appreciate your observations.

Bill

Please login to reply.