@ -39,9 +39,9 @@
# endif
# endif
# include <pthread.h>
# include <pthread.h>
# ifdef SNAPPY
# ifdef HAVE_ SNAPPY
# include <snappy.h>
# include <snappy.h>
# endif
# endif / / defined(HAVE_SNAPPY)
# include <stdint.h>
# include <stdint.h>
# include <string>
# include <string>
# include "port/atomic_pointer.h"
# include "port/atomic_pointer.h"
@ -106,33 +106,33 @@ extern void InitOnce(OnceType* once, void (*initializer)());
inline bool Snappy_Compress ( const char * input , size_t length ,
inline bool Snappy_Compress ( const char * input , size_t length ,
: : std : : string * output ) {
: : std : : string * output ) {
# ifdef SNAPPY
# ifdef HAVE_ SNAPPY
output - > resize ( snappy : : MaxCompressedLength ( length ) ) ;
output - > resize ( snappy : : MaxCompressedLength ( length ) ) ;
size_t outlen ;
size_t outlen ;
snappy : : RawCompress ( input , length , & ( * output ) [ 0 ] , & outlen ) ;
snappy : : RawCompress ( input , length , & ( * output ) [ 0 ] , & outlen ) ;
output - > resize ( outlen ) ;
output - > resize ( outlen ) ;
return true ;
return true ;
# endif
# endif / / defined(HAVE_SNAPPY)
return false ;
return false ;
}
}
inline bool Snappy_GetUncompressedLength ( const char * input , size_t length ,
inline bool Snappy_GetUncompressedLength ( const char * input , size_t length ,
size_t * result ) {
size_t * result ) {
# ifdef SNAPPY
# ifdef HAVE_ SNAPPY
return snappy : : GetUncompressedLength ( input , length , result ) ;
return snappy : : GetUncompressedLength ( input , length , result ) ;
# else
# else
return false ;
return false ;
# endif
# endif / / defined(HAVE_SNAPPY)
}
}
inline bool Snappy_Uncompress ( const char * input , size_t length ,
inline bool Snappy_Uncompress ( const char * input , size_t length ,
char * output ) {
char * output ) {
# ifdef SNAPPY
# ifdef HAVE_ SNAPPY
return snappy : : RawUncompress ( input , length , output ) ;
return snappy : : RawUncompress ( input , length , output ) ;
# else
# else
return false ;
return false ;
# endif
# endif / / defined(HAVE_SNAPPY)
}
}
inline bool GetHeapProfile ( void ( * func ) ( void * , const char * , int ) , void * arg ) {
inline bool GetHeapProfile ( void ( * func ) ( void * , const char * , int ) , void * arg ) {