I misread your question as it didn't say (until you send a clarification) that you were using Linux.
You don't need that "declspec" for gcc. That's a CodeWarrior thing to do with their calling conventions. Linux has ONE calling convention, so you don't have to worry about this.
What you DO need to worry about is calling machine-language functions. It looks like the CAU library has to read the condition codes. It looks like they provide an assembly-in-C function to do that. Had you provided the ENTIRE function rather than deleting the middle I could see what it does and advice what to do.
I note that previous (2012) answers in this thread say that the "library" is in Assembly. You won't be able to compile that if that's true.
Could you also post a link to the source of the library so I can see what it does and so what you are trying to do? Here's someone in 2011 looking for it (and not finding it):
https://community.nxp.com/t5/CodeWarrior-for-QorIQ/ColdFire-CAU-Software-Library/m-p/193501
Is it this one?
https://www.nxp.com/design/development-boards/tower-development-boards/mcu-and-processor-modules/kin...
The "README.txt" file in there says:
Assembly Language Format and Porting Considerations
These functions are written in the ColdFire assembler used by the Core &
Platform design team. This assembler may not be compatible with the wide
assortment of other development tools, but typically can be easily translated
into the required format.
It then gives some warnings. You have to be careful with the "cmp" instructions. Different assemblers have the source and destination in the opposite order.
But there's no "check_CC()" function in there, so I don't think that's the library you're using. The only place I can find that function is in TN270:
https://www.nxp.com/docs/en/application-note/TN270.pdf
As for that "check_CC()" function, the gcc compiler library (or other headers) may already supply an equivalent function that you should call instead. Otherwise you have to write an equivalent assembly function (if it is reading the CAU conditions, which I doubt) and make sure that obeys gcc's function calling convention for register usage and parameter passing.
In case anyone is searching for problems about running old example code on new versions of Codewarrior (and searches for keywords), I'll leave the following for reference:
This is a really OLD problem.
When CodeWarrior went from Version 7.1 to 7.2 (back in 2010, THAT long ago) they changed from supporting (standard_abi) to only supporting (register_abi). Read TN268 for details on this.
https://www.nxp.com/docs/en/application-note/TN268.pdf
With (standard_abi) aka "STD_ABI" the convention is to pass all parameters to functions on the stack. With (register_abi) it passes as many parameters as it can in registers. This makes the generated code smaller and faster. The problem is that ALL CODE (your code and all the compiler and system libraries) have to agree on this. It probably got too hard for them to support both, so 12 years ago they dropped support for the old way.
From my notes on this subject:
Search (at top right of this page) for "REG_ABI".
Other posts said that prior to 7.2 you could select either option, and all the libraries and example code on Freescale's web site defaulted to STD_ABI. With CW7.2 that option was removed, and it changed to REG_ABI. So all existing Assembly code broke, and none of the sample code (in App Notes and so on) got updated. This traps everybody, but isn't documented anywhere that I can find. It might be in the documentation provided with CW somewhere, I've never had a copy to check.
7.12 was released in June 2nd, 2009.
7.2 released 22 Jan 2010.
That also means that all the huge amount of example code for all their processors and modules STOPPED WORKING (or at least meant you couldn't compile and use it any more). They didn't convert and re-release this code to work "the new way", so it means that anyone wanting to use the old libraries has to learn everything about the CPU, the compiler, register conventions (become a literal super-expert) and do the conversion themselves.
Either that or use CodeWarrior 7.1 (or whatever was the last version to support the old code). You can't buy an old version, so if nobody kept a copy from.
Here's a post from me in 2013 about this:
https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Privilege-Violation-Exception/m-p/280548
Another from (like I said) 2010:
https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Problem-in-trying-to-get-MCF52233-DEMO-BO...
Tom