summaryrefslogtreecommitdiffstats
path: root/tests/cpp-compiler/cpp-compile-shared-library.cpp
blob: 8b70f258de4aa87a4cd363fb2ed91777d4409e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//TEST(smoke):CPP_COMPILER_SHARED_LIBRARY: 

//#include <slang.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <iostream>
using namespace std;
    
#if defined(_MSC_VER)
#   define DLL_EXPORT __declspec(dllexport)
#else
#   define DLL_EXPORT __attribute__((__visibility__("default")))
#endif    
    
extern "C" DLL_EXPORT int test(int intValue, const char* textValue, char* outTextValue)
{
    strcpy(outTextValue, textValue);
    return intValue;
}