mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-06 08:37:59 +08:00
ggwave : windows fixes (#95)
This commit is contained in:
committed by
GitHub
parent
55a0e2ba82
commit
614bcb3aae
@@ -28,7 +28,7 @@ if (EMSCRIPTEN)
|
||||
option(GGWAVE_WASM_SINGLE_FILE "ggwave: embed WASM inside the generated ggwave.js" ON)
|
||||
else()
|
||||
set(GGWAVE_SUPPORT_SDL2_DEFAULT ON)
|
||||
if (MINGW)
|
||||
if (WIN32)
|
||||
set(BUILD_SHARED_LIBS_DEFAULT OFF)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS_DEFAULT ON)
|
||||
|
||||
@@ -103,6 +103,7 @@ The [examples](https://github.com/ggerganov/ggwave/blob/master/examples/) folder
|
||||
|
||||
| Example | Description | Audio |
|
||||
| ------- | ----------- | ----- |
|
||||
| [ggtag](https://github.com/rgerganov/ggtag) | Sound-programmable e-paper badge | PDM mic |
|
||||
| [ggwave-rx](https://github.com/ggerganov/ggwave/blob/master/examples/ggwave-rx) | Very basic receive-only program | SDL |
|
||||
| [ggwave-cli](https://github.com/ggerganov/ggwave/blob/master/examples/ggwave-cli) | Command line tool for sending/receiving data through sound | SDL |
|
||||
| [ggwave-wasm](https://github.com/ggerganov/ggwave/blob/master/examples/ggwave-wasm) | WebAssembly module for web applications | SDL |
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "ggwave-common.h"
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
|
||||
2
examples/third-party/ggsock
vendored
2
examples/third-party/ggsock
vendored
Submodule examples/third-party/ggsock updated: 8f024e4aa5...25ea97004a
@@ -28,7 +28,8 @@ int main() {
|
||||
char decoded[16];
|
||||
|
||||
int n = ggwave_encode(instance, payload, 4, GGWAVE_PROTOCOL_AUDIBLE_FASTEST, 50, NULL, 1);
|
||||
char waveform[n];
|
||||
char *waveform = malloc(n);
|
||||
CHECK(waveform != NULL);
|
||||
|
||||
int ne = ggwave_encode(instance, payload, 4, GGWAVE_PROTOCOL_AUDIBLE_FASTEST, 50, waveform, 0);
|
||||
CHECK(ne > 0);
|
||||
@@ -71,6 +72,7 @@ int main() {
|
||||
CHECK(strcmp(decoded, payload) == 0);
|
||||
|
||||
ggwave_free(instance);
|
||||
free(waveform);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user