forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DEFINE'd symbols in SCC

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1011
Location: Morrison, CO, USA

PostPosted: Thu Jan 21, 2021 6:32 pm    Post subject: DEFINE'd symbols in SCC Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7142
Location: Salford, UK

PostPosted: Fri Jan 22, 2021 10:28 am    Post subject: Reply with quote

Yes. __64BIT__ is automatically defined when /64 is used on the SCC command line.
Back to top
View user's profile Send private message AIM Address
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 279

PostPosted: Fri Jan 22, 2021 5:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7142
Location: Salford, UK

PostPosted: Fri Jan 22, 2021 9:53 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 279

PostPosted: Wed Jan 27, 2021 12:32 pm    Post subject: Reply with quote

Paul,

thanks for the symbols Smile

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 Smile

Regards,
Dietmar
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7142
Location: Salford, UK

PostPosted: Wed Jan 27, 2021 12:55 pm    Post subject: Reply with quote

Dietmar

Thank you for the feedback.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1011
Location: Morrison, CO, USA

PostPosted: Wed Jan 27, 2021 9:00 pm    Post subject: Reply with quote

Thanks, Paul, this is helpful.

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

Bill
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group