Skip to content

Commit 57bf192

Browse files
committed
Fix Windows build
1 parent bcdda22 commit 57bf192

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 2-Clause License
22

3-
Copyright (c) 2021, Vasiliy Tereshkov
3+
Copyright (c) 2021-2023, Vasiliy Tereshkov
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

RAYLIB_LICENSE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
2+
3+
This software is provided "as-is", without any express or implied warranty. In no event
4+
will the authors be held liable for any damages arising from the use of this software.
5+
6+
Permission is granted to anyone to use this software for any purpose, including commercial
7+
applications, and to alter it and redistribute it freely, subject to the following restrictions:
8+
9+
1. The origin of this software must not be misrepresented; you must not claim that you
10+
wrote the original software. If you use this software in a product, an acknowledgment
11+
in the product documentation would be appreciated but is not required.
12+
13+
2. Altered source versions must be plainly marked as such, and must not be misrepresented
14+
as being the original software.
15+
16+
3. This notice may not be removed or altered from any source distribution.

build_umplot_windows_mingw.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
gcc -O3 umplot.c -o umplot.umi -shared -Wl,--dll -static-libgcc -static -lraylib -lumka -L%cd% -lkernel32 -luser32 -lgdi32 -lwinmm
1+
gcc -O3 -DUMKA_STATIC umplot.c -o umplot_windows.umi -shared -Wl,--dll -static-libgcc -static -lumka_static -lraylib -L. -lkernel32 -luser32 -lgdi32 -lwinmm

umplot.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
#include "font.h"
88

99

10+
#ifdef _WIN32
11+
#define UMPLOT_API __declspec(dllexport)
12+
#else
13+
#define UMPLOT_API __attribute__((visibility("default")))
14+
#endif
15+
16+
1017
enum
1118
{
1219
STYLE_LINE = 1,
@@ -424,7 +431,7 @@ static void drawZoomRect(Rectangle zoomRect, const ScreenTransform *transform)
424431
}
425432

426433

427-
void umplot_plot(UmkaStackSlot *params, UmkaStackSlot *result)
434+
UMPLOT_API void umplot_plot(UmkaStackSlot *params, UmkaStackSlot *result)
428435
{
429436
Plot *plot = (Plot *) params[0].ptrVal;
430437

umplot.um

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ fn (s: ^Series) clear*() {
5151
}
5252

5353
fn (s: ^Series) add*(x, y: real) {
54-
if !valid(s.points) {
55-
s.clear()
56-
}
5754
s.points = append(s.points, Point{x, y})
5855
}
5956

umplottest.um

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn main() {
44
plt := umplot.init(4)
55

66
for i := 0; i < 4; i++ {
7-
plt.series[i].name = "Sine wave " + repr(i + 1)
7+
plt.series[i].name = sprintf("Sine wave %d", i + 1)
88

99
for x := 0.0; x <= 100.0; x += 1.0 {
1010
y := (1 + 0.5 * i) * sin(x / 10.0 + i)

0 commit comments

Comments
 (0)