summaryrefslogtreecommitdiff
path: root/src/KM_fileio.h
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2008-08-09 01:09:50 +0000
committerjhurst <>2008-08-09 01:09:50 +0000
commit4e404673b69a7e2772579788a0b55c7037cee314 (patch)
treed6f05d45f382506786ba737adaa254433d1abb97 /src/KM_fileio.h
parent7827a7e7572601440568788cb028ee883498fa15 (diff)
The following changes have been checked into napali:
1. The is some template voodoo in KM_fileio.h to ward off the D_FILE_OFFSET_BITS=64 bug 2. KM_log.cpp now uses mutex protection for the global default LogSink 3. I added Kumu::Version (uses the same value as ASDCP::Version()). I did this because... 4. I modified Makefile.am so that kmfilegen, kmrandgen, and kmuuidgen only link against libkumu, as nature intended.
Diffstat (limited to 'src/KM_fileio.h')
-rwxr-xr-xsrc/KM_fileio.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/KM_fileio.h b/src/KM_fileio.h
index 58a2709..c7e102e 100755
--- a/src/KM_fileio.h
+++ b/src/KM_fileio.h
@@ -92,6 +92,26 @@ namespace Kumu
};
#endif
+ //
+#ifndef KM_SMALL_FILES_OK
+ template <bool sizecheck> void compile_time_size_checker();
+ template <> inline void compile_time_size_checker<false>() {}
+ //
+ // READ THIS if your compiler is complaining about a previously declared implementation of
+ // compile_time_size_checker(). For example, GCC 4.0.1 looks like this:
+ //
+ // error: 'void Kumu::compile_time_size_checker() [with bool sizecheck = false]' previously declared here
+ //
+ // This is happeining because the equality being tested below is false. The reason for this
+ // will depend on your OS, but on Linux it is probably because you have not used -D_FILE_OFFSET_BITS=64
+ // Adding this magic macro to your CFLAGS will get you going again. If you are on a system that
+ // does not support 64-bit files, you can disable this check by using -DKM_SMALL_FILES_OK. You
+ // will then of course be limited to file sizes < 4GB.
+ //
+ template <> inline void compile_time_size_checker<sizeof(Kumu::fsize_t)==sizeof(ui64_t)>() {}
+#endif
+ //
+
const ui32_t Kilobyte = 1024;
const ui32_t Megabyte = Kilobyte * Kilobyte;
const ui32_t Gigabyte = Megabyte * Kilobyte;