diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/KM_fileio.h | 20 | ||||
| -rwxr-xr-x | src/KM_log.cpp | 9 | ||||
| -rwxr-xr-x | src/KM_util.cpp | 7 | ||||
| -rwxr-xr-x | src/KM_util.h | 2 | ||||
| -rw-r--r-- | src/Makefile.am | 6 | ||||
| -rwxr-xr-x | src/kmfilegen.cpp | 2 | ||||
| -rw-r--r-- | src/kmrandgen.cpp | 2 | ||||
| -rw-r--r-- | src/kmuuidgen.cpp | 2 |
8 files changed, 42 insertions, 8 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; diff --git a/src/KM_log.cpp b/src/KM_log.cpp index aa0303b..3d34f1c 100755 --- a/src/KM_log.cpp +++ b/src/KM_log.cpp @@ -31,6 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <KM_util.h> #include <KM_log.h> +#include <KM_mutex.h> #include <sys/types.h> #include <string.h> #include <stdarg.h> @@ -58,20 +59,24 @@ Kumu::ILogSink::vLogf(LogType_t type, const char* fmt, va_list* list) //------------------------------------------------------------------------------------------ // -static Kumu::ILogSink* s_DefaultLogSink; +static Kumu::Mutex s_DefaultLogSinkLock; +static Kumu::ILogSink* s_DefaultLogSink = 0; static Kumu::StdioLogSink s_StderrLogSink; // void Kumu::SetDefaultLogSink(ILogSink* Sink) { - s_DefaultLogSink = Sink; + AutoMutex L(s_DefaultLogSinkLock); + s_DefaultLogSink = Sink; } // Returns the internal default sink. Kumu::ILogSink& Kumu::DefaultLogSink() { + AutoMutex L(s_DefaultLogSinkLock); + if ( s_DefaultLogSink == 0 ) s_DefaultLogSink = &s_StderrLogSink; diff --git a/src/KM_util.cpp b/src/KM_util.cpp index b860b64..b12d702 100755 --- a/src/KM_util.cpp +++ b/src/KM_util.cpp @@ -39,6 +39,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <map> #include <string> +const char* +Kumu::Version() +{ + return PACKAGE_VERSION; +} + + //------------------------------------------------------------------------------------------ // Result_t Internals diff --git a/src/KM_util.h b/src/KM_util.h index 40abbf0..d8b9bb3 100755 --- a/src/KM_util.h +++ b/src/KM_util.h @@ -40,6 +40,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Kumu { + // The version number declaration and explanation are in ../configure.ac + const char* Version(); // a class that represents the string form of a value template <class T, int SIZE = 16> diff --git a/src/Makefile.am b/src/Makefile.am index 7b509ca..a7666fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -67,11 +67,11 @@ asdcp_test_SOURCES = asdcp-test.cpp # list of libraries to link against for a program asdcp_test_LDADD = libasdcp.la kmfilegen_SOURCES = kmfilegen.cpp -kmfilegen_LDADD = libasdcp.la +kmfilegen_LDADD = libkumu.la kmrandgen_SOURCES = kmrandgen.cpp -kmrandgen_LDADD = libasdcp.la +kmrandgen_LDADD = libkumu.la kmuuidgen_SOURCES = kmuuidgen.cpp -kmuuidgen_LDADD = libasdcp.la +kmuuidgen_LDADD = libkumu.la blackwave_SOURCES = blackwave.cpp blackwave_LDADD = libasdcp.la klvwalk_SOURCES = klvwalk.cpp diff --git a/src/kmfilegen.cpp b/src/kmfilegen.cpp index 487f67a..b1f0a1a 100755 --- a/src/kmfilegen.cpp +++ b/src/kmfilegen.cpp @@ -74,7 +74,7 @@ Copyright (c) 2005-2008 John Hurst\n\ asdcplib may be copied only under the terms of the license found at\n\ the top of every file in the asdcplib distribution kit.\n\n\ Specify the -h (help) option for further information about %s\n\n", - PROGRAM_NAME, ASDCP::Version(), PROGRAM_NAME, PROGRAM_NAME); + PROGRAM_NAME, Kumu::Version(), PROGRAM_NAME, PROGRAM_NAME); } diff --git a/src/kmrandgen.cpp b/src/kmrandgen.cpp index d1098df..24f77af 100644 --- a/src/kmrandgen.cpp +++ b/src/kmrandgen.cpp @@ -59,7 +59,7 @@ Copyright (c) 2003-2008 John Hurst\n\n\ asdcplib may be copied only under the terms of the license found at\n\ the top of every file in the asdcplib distribution kit.\n\n\ Specify the -h (help) option for further information about %s\n\n", - PROGRAM_NAME, ASDCP::Version(), PROGRAM_NAME, PROGRAM_NAME); + PROGRAM_NAME, Kumu::Version(), PROGRAM_NAME, PROGRAM_NAME); } // diff --git a/src/kmuuidgen.cpp b/src/kmuuidgen.cpp index a7bfc42..2e1a868 100644 --- a/src/kmuuidgen.cpp +++ b/src/kmuuidgen.cpp @@ -56,7 +56,7 @@ Copyright (c) 2003-2008 John Hurst\n\n\ asdcplib may be copied only under the terms of the license found at\n\ the top of every file in the asdcplib distribution kit.\n\n\ Specify the -h (help) option for further information about %s\n\n", - PROGRAM_NAME, ASDCP::Version(), PROGRAM_NAME, PROGRAM_NAME); + PROGRAM_NAME, Kumu::Version(), PROGRAM_NAME, PROGRAM_NAME); } // |
