Fixes for compilation on Windows.

This commit is contained in:
Moritz Bunkus 2004-06-03 21:55:30 +00:00
parent e4c4dc68e2
commit 20d8d6b04c
2 changed files with 14 additions and 3 deletions

View File

@ -110,8 +110,8 @@ config.h: configure.in
# avilib-0.6.10 # avilib-0.6.10
# #
libavi_SOURCES = $(wildcard avilib-0.6.10/*.c) libavi_SOURCES = $(wildcard avilib-0.6.10/*.c) $(wildcard avilib-0.6.10/*.cpp)
libavi_OBJECTS := $(patsubst %.c,%.o,$(libavi_SOURCES)) libavi_OBJECTS := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(libavi_SOURCES)))
avilib-0.6.10/libavi.a: $(libavi_OBJECTS) avilib-0.6.10/libavi.a: $(libavi_OBJECTS)
rm -f $@ rm -f $@

View File

@ -266,7 +266,18 @@ bool mm_io_c::eof() {
int int
mm_io_c::truncate(int64_t pos) { mm_io_c::truncate(int64_t pos) {
_chsize((HANDLE)file, pos); bool result;
save_pos();
if (setFilePointer2(pos)) {
result = SetEndOfFile((HANDLE)file);
restore_pos();
if (result)
return 0;
return -1;
}
restore_pos();
return -1;
} }
#endif #endif