summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/AutoExportDll/cppCLI.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/AutoExportDll/cppCLI.cxx')
-rw-r--r--Tests/RunCMake/AutoExportDll/cppCLI.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/AutoExportDll/cppCLI.cxx b/Tests/RunCMake/AutoExportDll/cppCLI.cxx
new file mode 100644
index 0000000..816bb6e
--- /dev/null
+++ b/Tests/RunCMake/AutoExportDll/cppCLI.cxx
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+#ifdef __cplusplus_cli
+# include <msclr\marshal_cppstd.h>
+
+void cliFunction()
+{
+ System::String ^ result = "cliFunction";
+ result = result->Trim();
+ printf(msclr::interop::marshal_as<std::string>(result).c_str());
+}
+#else
+void cliFunction()
+{
+ printf("cliFunction (but /cli was not passed to the compiler)");
+}
+#endif
+
+void nonCliFunction()
+{
+ printf("nonCliFunction");
+}