提交 d88ccceb 编写于 作者: J Justine Tunney 提交者: TensorFlower Gardener

Rename SNAPPY to TF_USE_SNAPPY

This way there's less risk of it conflicting with downstream BUILD rules.

PiperOrigin-RevId: 172815580
上级 60a03dfc
......@@ -47,4 +47,4 @@ ExternalProject_Add(snappy
)
# actually enables snappy in the source code
add_definitions(-DSNAPPY)
\ No newline at end of file
add_definitions(-DTF_USE_SNAPPY)
......@@ -1410,7 +1410,7 @@ cc_library(
hdrs = LIB_INTERNAL_PUBLIC_HEADERS,
copts = tf_copts(),
defines = tf_additional_lib_defines() + [
"SNAPPY",
"TF_USE_SNAPPY",
] + tf_additional_verbs_lib_defines() +
tf_additional_mpi_lib_defines() +
tf_additional_gdr_lib_defines(),
......
......@@ -29,7 +29,7 @@ limitations under the License.
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
#include "snappy.h"
#endif
#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__)
......@@ -126,7 +126,7 @@ void AdjustFilenameForLogging(string* filename) {
}
bool Snappy_Compress(const char* input, size_t length, string* output) {
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
output->resize(snappy::MaxCompressedLength(length));
size_t outlen;
snappy::RawCompress(input, length, &(*output)[0], &outlen);
......@@ -139,7 +139,7 @@ bool Snappy_Compress(const char* input, size_t length, string* output) {
bool Snappy_GetUncompressedLength(const char* input, size_t length,
size_t* result) {
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
return snappy::GetUncompressedLength(input, length, result);
#else
return false;
......@@ -147,7 +147,7 @@ bool Snappy_GetUncompressedLength(const char* input, size_t length,
}
bool Snappy_Uncompress(const char* input, size_t length, char* output) {
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
return snappy::RawUncompress(input, length, output);
#else
return false;
......
......@@ -20,7 +20,7 @@ limitations under the License.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
#include "snappy.h"
#endif
......@@ -118,7 +118,7 @@ void AdjustFilenameForLogging(string* filename) {
}
bool Snappy_Compress(const char* input, size_t length, string* output) {
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
output->resize(snappy::MaxCompressedLength(length));
size_t outlen;
snappy::RawCompress(input, length, &(*output)[0], &outlen);
......@@ -131,7 +131,7 @@ bool Snappy_Compress(const char* input, size_t length, string* output) {
bool Snappy_GetUncompressedLength(const char* input, size_t length,
size_t* result) {
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
return snappy::GetUncompressedLength(input, length, result);
#else
return false;
......@@ -139,7 +139,7 @@ bool Snappy_GetUncompressedLength(const char* input, size_t length,
}
bool Snappy_Uncompress(const char* input, size_t length, char* output) {
#ifdef SNAPPY
#ifdef TF_USE_SNAPPY
return snappy::RawUncompress(input, length, output);
#else
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册