File tree 4 files changed +32
-10
lines changed
4 files changed +32
-10
lines changed Original file line number Diff line number Diff line change 1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- #ifndef __HOSTFXR_H__
5
- #define __HOSTFXR_H__
4
+ #ifndef HAVE_HOSTFXR_H
5
+ #define HAVE_HOSTFXR_H
6
6
7
7
#include <stddef.h>
8
8
#include <stdint.h>
9
9
10
+ #ifdef __cplusplus
11
+ extern "C"
12
+ {
13
+ #endif // __cplusplus
14
+
10
15
#if defined(_WIN32 )
11
16
#define HOSTFXR_CALLTYPE __cdecl
12
17
#ifdef _WCHAR_T_DEFINED
@@ -296,10 +301,6 @@ struct hostfxr_dotnet_environment_sdk_info
296
301
const char_t * path ;
297
302
};
298
303
299
- typedef void (HOSTFXR_CALLTYPE * hostfxr_get_dotnet_environment_info_result_fn )(
300
- const struct hostfxr_dotnet_environment_info * info ,
301
- void * result_context );
302
-
303
304
struct hostfxr_dotnet_environment_framework_info
304
305
{
305
306
size_t size ;
@@ -322,6 +323,10 @@ struct hostfxr_dotnet_environment_info
322
323
const struct hostfxr_dotnet_environment_framework_info * frameworks ;
323
324
};
324
325
326
+ typedef void (HOSTFXR_CALLTYPE * hostfxr_get_dotnet_environment_info_result_fn )(
327
+ const struct hostfxr_dotnet_environment_info * info ,
328
+ void * result_context );
329
+
325
330
//
326
331
// Returns available SDKs and frameworks.
327
332
//
@@ -415,4 +420,8 @@ typedef int32_t(HOSTFXR_CALLTYPE* hostfxr_resolve_frameworks_for_runtime_config_
415
420
/*opt*/ hostfxr_resolve_frameworks_result_fn callback ,
416
421
/*opt*/ void * result_context );
417
422
418
- #endif //__HOSTFXR_H__
423
+ #ifdef __cplusplus
424
+ }
425
+ #endif // __cplusplus
426
+
427
+ #endif // HAVE_HOSTFXR_H
Original file line number Diff line number Diff line change 1
1
# Licensed to the .NET Foundation under one or more agreements.
2
2
# The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- add_library (mockhostfxr_2_2 SHARED mockhostfxr.cpp)
5
- add_library (mockhostfxr_5_0 SHARED mockhostfxr.cpp)
4
+ set (MOCKHOSTFXR_SRC mockhostfxr.cpp test_c_api.c)
5
+
6
+ add_library (mockhostfxr_2_2 SHARED ${MOCKHOSTFXR_SRC} )
7
+ add_library (mockhostfxr_5_0 SHARED ${MOCKHOSTFXR_SRC} )
6
8
7
9
target_link_libraries (mockhostfxr_2_2 PRIVATE libhostcommon)
8
10
target_link_libraries (mockhostfxr_5_0 PRIVATE libhostcommon)
@@ -11,4 +13,4 @@ target_compile_definitions(mockhostfxr_2_2 PRIVATE MOCKHOSTFXR_2_2 EXPORT_SHARED
11
13
target_compile_definitions (mockhostfxr_5_0 PRIVATE MOCKHOSTFXR_5_0 EXPORT_SHARED_API)
12
14
13
15
install_with_stripped_symbols(mockhostfxr_2_2 TARGETS corehost_test)
14
- install_with_stripped_symbols(mockhostfxr_5_0 TARGETS corehost_test)
16
+ install_with_stripped_symbols(mockhostfxr_5_0 TARGETS corehost_test)
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
1
4
#include " error_codes.h"
2
5
#include " hostfxr.h"
3
6
#include " host_startup_info.h"
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ // hostfxr.h is a public API. When included in .c files, it may fail to compile
5
+ // if C++-specific syntax is used within the extern "C" block. Since all usage of
6
+ // this API in runtime repo is within C++ code, such breakages are not encountered
7
+ // during normal development or testing.
8
+ #include "hostfxr.h"
You can’t perform that action at this time.
0 commit comments