Skip to content

Commit

Permalink
Fix: Visibility and extern fixed for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueaklein committed Aug 20, 2024
1 parent 3474d51 commit 8ba1877
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/GeniusSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static outcome::result<DevConfig_st, JsonError> ReadDevConfigFromJSON( const std

std::shared_ptr<sgns::GeniusNode> GeniusNodeInstance;

GNUS_VISIBILITY_DEFAULT GNUS_EXPORT const char *GeniusSDKInit( const char *base_path )
const char *GeniusSDKInit( const char *base_path )
{
std::string path = "";
if ( base_path != nullptr )
Expand All @@ -104,7 +104,7 @@ GNUS_VISIBILITY_DEFAULT GNUS_EXPORT const char *GeniusSDKInit( const char *base_
return ret_val.c_str();
}

GNUS_VISIBILITY_DEFAULT GNUS_EXPORT void GeniusSDKProcess( const ImagePath_t path, const PayAmount_t amount )
void GeniusSDKProcess( const ImagePath_t path, const PayAmount_t amount )
{
GeniusNodeInstance->ProcessImage( std::string{ path }, amount );
}
20 changes: 9 additions & 11 deletions src/GeniusSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

#include <memory>

#ifndef GNUS_EXPORT
#define GNUS_EXPORT extern "C"
#ifndef GNUS_EXPORT_BEGIN
#if defined(__cplusplus)
#define GNUS_EXPORT_BEGIN extern "C" {
#define GNUS_EXPORT_END }
#endif
#endif

#ifdef _WIN32
Expand All @@ -19,19 +22,14 @@
#define GNUS_VISIBILITY_DEFAULT __attribute__( ( visibility( "default" ) ) )
#endif

#ifndef __cplusplus
extern "C"
{
#endif
GNUS_EXPORT_BEGIN

typedef char ImagePath_t[1024]; ///< ID/Path of the image to be processed
typedef uint64_t PayAmount_t; ///< Amount to be paid for the processing

#ifndef __cplusplus
}
#endif
GNUS_VISIBILITY_DEFAULT const char *GeniusSDKInit( const char *base_path );
GNUS_VISIBILITY_DEFAULT void GeniusSDKProcess( const ImagePath_t path, const PayAmount_t amount );

GNUS_VISIBILITY_DEFAULT GNUS_EXPORT const char *GeniusSDKInit( const char *base_path );
GNUS_VISIBILITY_DEFAULT GNUS_EXPORT void GeniusSDKProcess( const ImagePath_t path, const PayAmount_t amount );
GNUS_EXPORT_END

#endif //GENIUSSDK_H

0 comments on commit 8ba1877

Please sign in to comment.