mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-13 09:06:56 -04:00
Add support for Windows/Cygwin
This commit is based on Tom Hall's patch.
This commit is contained in:
parent
05eceb342d
commit
a41f4a0c08
7
Makefile
7
Makefile
@ -12,5 +12,12 @@ mac:
|
|||||||
gcc -o f3write utils.o f3write.o -lm
|
gcc -o f3write utils.o f3write.o -lm
|
||||||
gcc -o f3read utils.o f3read.o
|
gcc -o f3read utils.o f3read.o
|
||||||
|
|
||||||
|
cygwin:
|
||||||
|
gcc -Wall -Wno-char-subscripts -DCYGWIN -c utils.c
|
||||||
|
gcc -Wall -Wno-char-subscripts -DCYGWIN -c f3write.c
|
||||||
|
gcc -Wall -Wno-char-subscripts -DCYGWIN -c f3read.c
|
||||||
|
gcc -o f3write utils.o f3write.o -lm
|
||||||
|
gcc -o f3read utils.o f3read.o
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o f3write f3read
|
rm -f *.o f3write f3read
|
||||||
|
4
README
4
README
@ -6,6 +6,10 @@ make linux
|
|||||||
|
|
||||||
make mac
|
make mac
|
||||||
|
|
||||||
|
### Compile on Windows with Cygwin
|
||||||
|
|
||||||
|
make cygwin
|
||||||
|
|
||||||
### Use example
|
### Use example
|
||||||
|
|
||||||
./f3write /media/5EBD-5C80/
|
./f3write /media/5EBD-5C80/
|
||||||
|
4
utils.c
4
utils.c
@ -141,7 +141,7 @@ void print_header(FILE *f, char *name)
|
|||||||
"\n", name);
|
"\n", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_MAC
|
#if defined(APPLE_MAC) || defined (CYGWIN)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -216,4 +216,4 @@ int lrand48_r(struct drand48_data *buffer, long int *result)
|
|||||||
return __nrand48_r(buffer->__x, buffer, result);
|
return __nrand48_r(buffer->__x, buffer, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* APPLE_MAC */
|
#endif /* APPLE_MAC or CYGWIN */
|
||||||
|
6
utils.h
6
utils.h
@ -64,6 +64,10 @@ static inline int posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* APPLE_MAC */
|
||||||
|
|
||||||
|
#if defined(APPLE_MAC) || defined(CYGWIN)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following functions were copied from GNU Library C to make F3
|
* The following functions were copied from GNU Library C to make F3
|
||||||
* more portable.
|
* more portable.
|
||||||
@ -89,6 +93,6 @@ extern int srand48_r(long int __seedval, struct drand48_data *__buffer)
|
|||||||
extern int lrand48_r(struct drand48_data *__restrict __buffer,
|
extern int lrand48_r(struct drand48_data *__restrict __buffer,
|
||||||
long int *__restrict __result) __attribute__ ((nonnull(1, 2)));
|
long int *__restrict __result) __attribute__ ((nonnull(1, 2)));
|
||||||
|
|
||||||
#endif /* APPLE_MAC */
|
#endif /* APPLE_MAC or CYGWIN */
|
||||||
|
|
||||||
#endif /* HEADER_UTILS_H */
|
#endif /* HEADER_UTILS_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user