summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2023-09-25 23:38:03 +0200
committercbdev <cb@cbcdn.com>2023-09-25 23:38:03 +0200
commit25188a3bb756efc9fa13b552f3d2c8ba3d05e69c (patch)
tree648630043fcf35a5b3e593d80499760ea7b56b9d
parent3c018eab670be40ffd1841ad9946f5f555b4a76a (diff)
downloadwavextract-25188a3bb756efc9fa13b552f3d2c8ba3d05e69c.tar.gz
wavextract-25188a3bb756efc9fa13b552f3d2c8ba3d05e69c.tar.bz2
wavextract-25188a3bb756efc9fa13b552f3d2c8ba3d05e69c.zip
Fix Windows build
-rw-r--r--wavextract.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/wavextract.c b/wavextract.c
index 137d1a0..627406a 100644
--- a/wavextract.c
+++ b/wavextract.c
@@ -4,19 +4,15 @@
#include <errno.h>
#include <stdint.h>
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <inttypes.h>
-#include <math.h>
-#include <ctype.h>
#define VERSION "0.1"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
- #define PRIsize_t "Iu"
+ #define PRIsize_t "llu"
#define htole16(x) (x)
#define htole32(x) (x)
#else
@@ -185,12 +181,12 @@ int main(int argc, char** argv){
//read sample
if(read(source_fd, &sample, 2) != 2){
close(source_fd);
- fprintf(stderr, "Failed to read input data at sample %ld: %s\n", n, strerror(errno));
+ fprintf(stderr, "Failed to read input data at sample %" PRIsize_t ": %s\n", n, strerror(errno));
return EXIT_FAILURE;
}
if(channel == 0){
- printf("%ld,%d", n, (int16_t) sample);
+ printf("%" PRIsize_t ",%d", n, (int16_t) sample);
}
else{
printf(",%d", (int16_t) sample);
@@ -205,6 +201,6 @@ int main(int argc, char** argv){
}
close(source_fd);
- fprintf(stderr, "Done, exported %ld frames of data %d channels, processed %ld samples\n", n, fmt.channels, fmt.channels * n);
+ fprintf(stderr, "Done, exported %" PRIsize_t " frames of data %d channels, processed %" PRIsize_t " samples\n", n, fmt.channels, fmt.channels * n);
return EXIT_SUCCESS;
}