LabWindows/CVI

Content Type
Programming Language
Current manual

GetCurrentPlatform

GetCurrentPlatform

int GetCurrentPlatform (void);

Purpose

Returns a code that represents the operating system under which a project or standalone executable is running.

Do not confuse the return value of GetCurrentPlatform with the predefined macros such as _NI_mswin_ and others, which specify the platform on which you compile a source file.

GetCurrentPlatform is useful when you have a program that can run under multiple operating systems but must take different actions on the different systems. For example, consider a stand-alone executable that can run under Windows and Linux. If the program must behave differently on the two platforms, you can use GetCurrentPlatform to determine the platform at run time.

Parameters

None.

Return Value

Name Type Description
platform int The current operating system.

Message Code Platform
kPlatformWinnt 3 Windows
kPlatformLinuxX86 9 Linux

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Was this information helpful?