View previous topic :: View next topic |
Author |
Message |
wahorger

Joined: 13 Oct 2014 Posts: 1248 Location: Morrison, CO, USA
|
Posted: Thu Jan 21, 2021 6:32 pm Post subject: DEFINE'd symbols in SCC |
|
|
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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8119 Location: Salford, UK
|
Posted: Fri Jan 22, 2021 10:28 am Post subject: |
|
|
Yes. __64BIT__ is automatically defined when /64 is used on the SCC command line. |
|
Back to top |
|
 |
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Fri Jan 22, 2021 5:15 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8119 Location: Salford, UK
|
Posted: Fri Jan 22, 2021 9:53 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Wed Jan 27, 2021 12:32 pm Post subject: |
|
|
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:
Code: |
#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 |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8119 Location: Salford, UK
|
Posted: Wed Jan 27, 2021 12:55 pm Post subject: |
|
|
Dietmar
Thank you for the feedback. |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1248 Location: Morrison, CO, USA
|
Posted: Wed Jan 27, 2021 9:00 pm Post subject: |
|
|
Thanks, Paul, this is helpful.
Dietmar, thanks for the code segment. It will be useful, and I appreciate your observations.
Bill |
|
Back to top |
|
 |
|