Browse Source

Clean up lzma code

For some reason we were including the lzma code both via a static library and
by directly including the .c files within jlzma.cpp. The latter was causing
gcc 4.2 (Mac version) to core for reasons I was unable to determine.

Removing the inclusion seems like a much cleaner solution anyway. To avoid
link errors resulting from the fact that we have not set up C compiler flags,
use the C++ compiler to compile them.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 years ago
parent
commit
9519579153
2 changed files with 1 additions and 24 deletions
  1. 0 19
      system/jlib/jlzma.cpp
  2. 1 5
      system/lzma/CMakeLists.txt

+ 0 - 19
system/jlib/jlzma.cpp

@@ -22,30 +22,11 @@
 
 #include "jlzma.hpp"
 
-#ifdef _WIN32
-extern "C" {
-#endif
 #include "Types.h"
 #include "LzFind.h"
 #include "LzHash.h"
 #include "LzmaEnc.h"
 #include "LzmaDec.h"
-#ifdef _WIN32
-}
-#endif
-
-#ifdef _WIN32 // Kludge to avoid using library (too many VS6 .dsws out there!)
-extern "C" {
-#endif
-#include "LzFind.c"
-#include "LzmaEnc.c"
-#undef kNumFullDistances
-#define kLiteralNextStates decLiteralNextStates
-#include "LzmaDec.c"
-#ifdef _WIN32
-}
-#endif
-
 
 static void *SzAlloc(void *, size_t size)
 { 

+ 1 - 5
system/lzma/CMakeLists.txt

@@ -32,13 +32,9 @@ set ( SRCS
         LzmaEnc.c
 )
 
-# CSRCS = \ 
-# LzFind.c \ 
-# LzmaDec.c \ 
-# LzmaInc.c 
-# COBJS = \ 
 ADD_DEFINITIONS( -D_LIB )
 
+SET_SOURCE_FILES_PROPERTIES( ${SRCS} PROPERTIES LANGUAGE CXX )
 HPCC_ADD_LIBRARY( lzma STATIC ${SRCS} )
 install ( TARGETS lzma DESTINATION ${OSSDIR}/lib )