Skip to content

Commit bc42ffd

Browse files
committed
fix: possible redefinition of macro and typo
1 parent 2b155b6 commit bc42ffd

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

include/webui_extensions.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ extern "C" {
2424
* - In other cases, as long as the webui.c file is not included directly,
2525
* you might need to define this macro in your compiler settings
2626
*/
27-
#define WEBUI_EXTENSIONS_API
27+
#ifndef WEBUI_EXTENSION_API
28+
#define WEBUI_EXTENSION_API
29+
#endif
30+
31+
#ifndef WEBUI_EXPORT
32+
#define WEBUI_EXPORT
33+
#warning "WEBUI_EXPORT not defined; Please include webui.h before webui_extensions.h"
34+
#endif
2835

2936
#include <stdbool.h>
3037
#include <stddef.h>
@@ -44,7 +51,7 @@ extern "C" {
4451
*
4552
* @example webui_run_fmt(myWindow, "alert('Hello %s');", "World");
4653
*/
47-
void webui_run_fmt(size_t window, const char* fmt, ...);
54+
WEBUI_EXPORT void webui_run_fmt(size_t window, const char* fmt, ...);
4855

4956
/**
5057
* @brief Construct a JavaScript string from a format string,
@@ -68,7 +75,7 @@ void webui_run_fmt(size_t window, const char* fmt, ...);
6875
* @example bool err = webui_script_fmt(myWindow, 0, myBuffer, myBufferSize,
6976
* "return %d + %d;", 4, 6);
7077
*/
71-
bool webui_script_fmt(size_t window, size_t timeout,
78+
WEBUI_EXPORT bool webui_script_fmt(size_t window, size_t timeout,
7279
char* buffer, size_t buffer_length,
7380
const char* fmt, ...);
7481

0 commit comments

Comments
 (0)