07-22-2016 03:23 PM
I'm presently working on remote control of the UHF Lock In Amplifier from Zurich Instruments. A header file provided by the company as an API for C makes heavy use of the GCC attributes.
Example lines:
__attribute__((deprecated)) const ZIVariable_Defined_By_Company
[...]
typedef ZIDefinedType_enum DEPRECATED(ziAPIOtherType);
Is there some way (a header file perhaps) to add this functionality to the CVI compiler? Or otherwise to trick the API into ignoring it? This is important because when I include the lines:
#define __attribute__(decl)
#define __deprecated __attribute__((deprecated))
#define DEPRECATED_MSG_ATTRIBUTE(msg) __attribute((deprecated((msg)))
#include "APIfilename.h"
I repeatedly get the error "Redeclearation of 'deprecated'." from the typedef lines. I can't reasonably fix every instance in their file; moreover, I would prefer to leave the file they provided unchanged and fix it on my end.
07-25-2016 01:19 PM
Hi anMTLphysicsgeek,
LabWindows/CVI uses the CLANG compiler. You can take a look at the attributes in CLANG to see if you can find similar attributes. Also, you can do the C extensions listed on this KnowledgeBase article.
07-27-2016 09:31 AM
The knoledge base article looks very useful. Thanks!
Unless I don't really understand it though, it looks like it says that they are supported. I think my CVI is out of date, so I will try updating that and let you know if it works.
Cheers!