diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /tests/cpp-compiler/c-compile-shared-library-link-error.c | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'tests/cpp-compiler/c-compile-shared-library-link-error.c')
| -rw-r--r-- | tests/cpp-compiler/c-compile-shared-library-link-error.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/cpp-compiler/c-compile-shared-library-link-error.c b/tests/cpp-compiler/c-compile-shared-library-link-error.c index 1339a3b52..6f48fb435 100644 --- a/tests/cpp-compiler/c-compile-shared-library-link-error.c +++ b/tests/cpp-compiler/c-compile-shared-library-link-error.c @@ -1,27 +1,26 @@ -//TEST(smoke):CPP_COMPILER_SHARED_LIBRARY: +// TEST(smoke):CPP_COMPILER_SHARED_LIBRARY: -#include <stdlib.h> #include <stdio.h> -#include <string.h> - +#include <stdlib.h> +#include <string.h> + #if defined(_MSC_VER) -# define DLL_EXPORT __declspec(dllexport) -#else -//# define DLL_EXPORT -# define DLL_EXPORT __attribute__ ((dllexport)) __attribute__((__visibility__("default"))) -#endif +#define DLL_EXPORT __declspec(dllexport) +#else +// # define DLL_EXPORT +#define DLL_EXPORT __attribute__((dllexport)) __attribute__((__visibility__("default"))) +#endif -#ifdef __cplusplus +#ifdef __cplusplus #define EXTERN_C extern "C" #else -#define EXTERN_C -#endif +#define EXTERN_C +#endif extern int symbolNotFound; - + EXTERN_C DLL_EXPORT int test(int intValue, const char* textValue, char* outTextValue) { strcpy(outTextValue, textValue); return intValue + symbolNotFound; } - |
