CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to recognize that CCS Compiler is used

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

How to recognize that CCS Compiler is used
PostPosted: Mon Mar 21, 2011 2:23 am     Reply with quote

Hi all.
Is there any way how to generally recognize that the code is being compiled by the CCS compiler?
Such as
Code:
#if defined(CCS_C)


Apart from
Code:
#if defined(__PCM__)
and others.

Cheers
Meereck
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 21, 2011 1:08 pm     Reply with quote

I searched the DLL files for anything starting with '__' (double underscore),
and I couldn't see __CCS__ or __PICC__ or anything like that. So I
think it doesn't exist.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 21, 2011 1:38 pm     Reply with quote

One quick idea...
Don't know if anyone else does but CCS puts SLEEP as the last instruction in their compiled code.
You could look at several programs you've cut to see if this is alway true.
If so, simple to search for.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 21, 2011 1:40 pm     Reply with quote

I think he wants a way to make universal source code, so that he can
compile it with CCS or another compiler, and it will compile in either
compiler, without having to do any edits.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 21, 2011 1:53 pm     Reply with quote

If so, that's why COBOL was invented.... First section dictated what type of machine it was to be used on, remaining sections were common 'universal' source code. Sure made life easy when 'flipping' between 3 or 4 systems....

Mind you that was 30 years ago.....
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

PostPosted: Mon Mar 21, 2011 5:58 pm     Reply with quote

PCM programmer wrote:
I think he wants a way to make universal source code, so that he can
compile it with CCS or another compiler, and it will compile in either
compiler, without having to do any edits.


You are totally correct. I think I will have to use all the statements:
defined(__PCM__)
defined(__PCH__)
etc., since nothing general exists.

Cheers
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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