Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
vtereshkov committed Aug 15, 2023
1 parent bcdda22 commit 57bf192
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2021, Vasiliy Tereshkov
Copyright (c) 2021-2023, Vasiliy Tereshkov
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
16 changes: 16 additions & 0 deletions RAYLIB_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you
wrote the original software. If you use this software in a product, an acknowledgment
in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented
as being the original software.

3. This notice may not be removed or altered from any source distribution.
2 changes: 1 addition & 1 deletion build_umplot_windows_mingw.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gcc -O3 umplot.c -o umplot.umi -shared -Wl,--dll -static-libgcc -static -lraylib -lumka -L%cd% -lkernel32 -luser32 -lgdi32 -lwinmm
gcc -O3 -DUMKA_STATIC umplot.c -o umplot_windows.umi -shared -Wl,--dll -static-libgcc -static -lumka_static -lraylib -L. -lkernel32 -luser32 -lgdi32 -lwinmm
9 changes: 8 additions & 1 deletion umplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
#include "font.h"


#ifdef _WIN32
#define UMPLOT_API __declspec(dllexport)
#else
#define UMPLOT_API __attribute__((visibility("default")))
#endif


enum
{
STYLE_LINE = 1,
Expand Down Expand Up @@ -424,7 +431,7 @@ static void drawZoomRect(Rectangle zoomRect, const ScreenTransform *transform)
}


void umplot_plot(UmkaStackSlot *params, UmkaStackSlot *result)
UMPLOT_API void umplot_plot(UmkaStackSlot *params, UmkaStackSlot *result)
{
Plot *plot = (Plot *) params[0].ptrVal;

Expand Down
3 changes: 0 additions & 3 deletions umplot.um
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ fn (s: ^Series) clear*() {
}

fn (s: ^Series) add*(x, y: real) {
if !valid(s.points) {
s.clear()
}
s.points = append(s.points, Point{x, y})
}

Expand Down
2 changes: 1 addition & 1 deletion umplottest.um
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main() {
plt := umplot.init(4)

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

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

0 comments on commit 57bf192

Please sign in to comment.