Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix export/import of DLL symbols #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if (NOT DEFINED CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)

Expand Down Expand Up @@ -77,8 +76,8 @@ target_compile_definitions(
replxx
PUBLIC
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:REPLXX_STATIC>
$<$<BOOL:${BUILD_SHARED_LIBS}>:REPLXX_BUILDING_DLL>
PRIVATE
$<$<BOOL:${BUILD_SHARED_LIBS}>:REPLXX_BUILDING_DLL>
$<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS=1 /ignore:4503>
)
target_compile_options(
Expand Down
16 changes: 8 additions & 8 deletions include/replxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ REPLXX_IMPEXP void replxx_bind_key( Replxx*, int code, key_press_handler_t handl
* \param actionName - name of internal action to be invoked on key press.
* \return -1 if invalid action name was used, 0 otherwise.
*/
int replxx_bind_key_internal( Replxx*, int code, char const* actionName );
REPLXX_IMPEXP int replxx_bind_key_internal( Replxx*, int code, char const* actionName );

REPLXX_IMPEXP void replxx_set_preload_buffer( Replxx*, const char* preloadText );

Expand Down Expand Up @@ -584,7 +584,7 @@ REPLXX_IMPEXP int replxx_history_load( Replxx*, const char* filename );
REPLXX_IMPEXP void replxx_history_clear( Replxx* );
REPLXX_IMPEXP void replxx_clear_screen( Replxx* );
#ifdef __REPLXX_DEBUG__
void replxx_debug_dump_print_codes(void);
REPLXX_IMPEXP void replxx_debug_dump_print_codes(void);
#endif
/* the following is extension to the original linenoise API */
REPLXX_IMPEXP int replxx_install_window_change_handler( Replxx* );
Expand All @@ -599,35 +599,35 @@ REPLXX_IMPEXP void replxx_disable_bracketed_paste( Replxx* );
* \param color2 - second input color.
* \return A new color definition that represent combined input colors.
*/
ReplxxColor replxx_color_combine( ReplxxColor color1, ReplxxColor color2 );
REPLXX_IMPEXP ReplxxColor replxx_color_combine( ReplxxColor color1, ReplxxColor color2 );

/*! \brief Transform foreground color definition into a background color definition.
*
* \param color - an input foreground color definition.
* \return A background color definition that is a transformed input \e color.
*/
ReplxxColor replxx_color_bg( ReplxxColor color );
REPLXX_IMPEXP ReplxxColor replxx_color_bg( ReplxxColor color );

/*! \brief Add `bold` attribute to color definition.
*
* \param color - an input color definition.
* \return A new color definition with bold attribute set.
*/
ReplxxColor replxx_color_bold( ReplxxColor color );
REPLXX_IMPEXP ReplxxColor replxx_color_bold( ReplxxColor color );

/*! \brief Add `underline` attribute to color definition.
*
* \param color - an input color definition.
* \return A new color definition with underline attribute set.
*/
ReplxxColor replxx_color_underline( ReplxxColor color );
REPLXX_IMPEXP ReplxxColor replxx_color_underline( ReplxxColor color );

/*! \brief Create a new grayscale color of given brightness level.
*
* \param level - a brightness level for new color, must be between 0 (darkest) and 23 (brightest).
* \return A new grayscale color of a given brightest \e level.
*/
ReplxxColor replxx_color_grayscale( int level );
REPLXX_IMPEXP ReplxxColor replxx_color_grayscale( int level );

/*! \brief Create a new color in 6×6×6 RGB color space from base component levels.
*
Expand All @@ -636,7 +636,7 @@ ReplxxColor replxx_color_grayscale( int level );
* \param blue - a blue (of RGB) component level, must be 0 and 5.
* \return A new color in 6×6×6 RGB color space.
*/
ReplxxColor replxx_color_rgb666( int red, int green, int blue );
REPLXX_IMPEXP ReplxxColor replxx_color_rgb666( int red, int green, int blue );

#ifdef __cplusplus
}
Expand Down
14 changes: 7 additions & 7 deletions include/replxx.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public:
}
};
class HistoryScanImpl;
class HistoryScan {
class REPLXX_IMPEXP HistoryScan {
public:
typedef std::unique_ptr<HistoryScanImpl, void (*)( HistoryScanImpl* )> impl_t;
private:
Expand Down Expand Up @@ -663,35 +663,35 @@ namespace color {
* \param color2 - second input color.
* \return A new color definition that represent combined input colors.
*/
Replxx::Color operator | ( Replxx::Color color1, Replxx::Color color2 );
REPLXX_IMPEXP Replxx::Color operator | ( Replxx::Color color1, Replxx::Color color2 );

/*! \brief Transform foreground color definition into a background color definition.
*
* \param color - an input foreground color definition.
* \return A background color definition that is a transformed input \e color.
*/
Replxx::Color bg( Replxx::Color color );
REPLXX_IMPEXP Replxx::Color bg( Replxx::Color color );

/*! \brief Add `bold` attribute to color definition.
*
* \param color - an input color definition.
* \return A new color definition with bold attribute set.
*/
Replxx::Color bold( Replxx::Color color );
REPLXX_IMPEXP Replxx::Color bold( Replxx::Color color );

/*! \brief Add `underline` attribute to color definition.
*
* \param color - an input color definition.
* \return A new color definition with underline attribute set.
*/
Replxx::Color underline( Replxx::Color color );
REPLXX_IMPEXP Replxx::Color underline( Replxx::Color color );

/*! \brief Create a new grayscale color of given brightness level.
*
* \param level - a brightness level for new color, must be between 0 (darkest) and 23 (brightest).
* \return A new grayscale color of a given brightest \e level.
*/
Replxx::Color grayscale( int level );
REPLXX_IMPEXP Replxx::Color grayscale( int level );

/*! \brief Create a new color in 6×6×6 RGB color space from base component levels.
*
Expand All @@ -700,7 +700,7 @@ Replxx::Color grayscale( int level );
* \param blue - a blue (of RGB) component level, must be 0 and 5.
* \return A new color in 6×6×6 RGB color space.
*/
Replxx::Color rgb666( int red, int green, int blue );
REPLXX_IMPEXP Replxx::Color rgb666( int red, int green, int blue );

}

Expand Down