View previous topic :: View next topic |
Author |
Message |
meereck
Joined: 09 Nov 2006 Posts: 173
|
How to recognize that CCS Compiler is used |
Posted: Mon Mar 21, 2011 2:23 am |
|
|
Hi all.
Is there any way how to generally recognize that the code is being compiled by the CCS compiler?
Such as
Apart from
Code: | #if defined(__PCM__) | and others.
Cheers
Meereck |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Mar 21, 2011 1:08 pm |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Mon Mar 21, 2011 1:38 pm |
|
|
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
|
|
Posted: Mon Mar 21, 2011 1:40 pm |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Mon Mar 21, 2011 1:53 pm |
|
|
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
|
|
Posted: Mon Mar 21, 2011 5:58 pm |
|
|
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 |
|
|
|