Skip to content

Commit

Permalink
clang-formatting the files
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanKrMahato committed Nov 11, 2024
1 parent c8661f3 commit 183f465
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
29 changes: 15 additions & 14 deletions source/dynlink/include/dynlink/dynlink_impl_symbol_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#include <preprocessor/preprocessor_concatenation.h>

#ifdef __cplusplus
extern "C" {
extern "C"
{
#endif

/* -- Definitions -- */
Expand All @@ -44,25 +45,25 @@ extern "C" {
} PREPROCESSOR_CONCAT(dynlink_no_export_, name)

#if defined(__MINGW32__) || defined(__MINGW64__)
#define DYNLINK_SYMBOL_GET(name) \
(((dynlink_symbol_addr_win32)(name))->symbol)
#else
#define DYNLINK_SYMBOL_GET(name) name
#define DYNLINK_SYMBOL_GET(name) \
(((dynlink_symbol_addr_win32)(name))->symbol)
#else
#define DYNLINK_SYMBOL_GET(name) name
#endif

/* -- Type definitions -- */

#if defined(__MINGW32__) || defined(__MINGW64__)
/* MinGW-compatible definition */
typedef void (*dynlink_symbol_addr_win32_impl)(void);

typedef struct dynlink_symbol_addr_win32_type
{
dynlink_symbol_addr_win32_impl symbol;
} * dynlink_symbol_addr_win32;
/* MinGW-compatible definition */
typedef void (*dynlink_symbol_addr_win32_impl)(void);

typedef struct dynlink_symbol_addr_win32_type
{
dynlink_symbol_addr_win32_impl symbol;
} *dynlink_symbol_addr_win32;

#else
typedef void (*dynlink_symbol_addr_win32)(void);
typedef void (*dynlink_symbol_addr_win32)(void);
#endif

typedef dynlink_symbol_addr_win32 dynlink_symbol_addr;
Expand Down
19 changes: 9 additions & 10 deletions source/dynlink/source/dynlink_impl_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,15 @@ int dynlink_impl_interface_symbol_win32(dynlink handle, dynlink_impl impl, dynli

(void)handle;


#if defined(__MINGW32__) || defined(__MINGW64__)
// For MinGW, set the symbol member of the struct
(*addr)->symbol = (dynlink_symbol_addr_win32_impl)proc_addr;
#else
// For MSVC or other compilers, cast directly
*addr = (dynlink_symbol_addr)proc_addr;
#endif
return (*addr == NULL);
}
#if defined(__MINGW32__) || defined(__MINGW64__)
// For MinGW, set the symbol member of the struct
(*addr)->symbol = (dynlink_symbol_addr_win32_impl)proc_addr;
#else
// For MSVC or other compilers, cast directly
*addr = (dynlink_symbol_addr)proc_addr;
#endif
return (*addr == NULL);
}

int dynlink_impl_interface_unload_win32(dynlink handle, dynlink_impl impl)
{
Expand Down

0 comments on commit 183f465

Please sign in to comment.