LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Imitate GCC attributes in CVI

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.

0 Kudos
Message 1 of 3
(3,130 Views)

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.

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

0 Kudos
Message 2 of 3
(3,079 Views)

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!

0 Kudos
Message 3 of 3
(3,064 Views)