From 63b2f999d3f22cfe915b89103faa1b0a1b1b7617 Mon Sep 17 00:00:00 2001 From: Saurabh Saxena Date: Thu, 30 Mar 2017 11:52:01 -0800 Subject: Enable snappy. Fix implicit type cast bug in snappy_inputbuffer. Bitwise OR of unsigned int and signed char can cause unexpected issues so we explicitly cast it to unsigned char. Change: 151737878 --- third_party/snappy.BUILD | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 third_party/snappy.BUILD (limited to 'third_party/snappy.BUILD') diff --git a/third_party/snappy.BUILD b/third_party/snappy.BUILD new file mode 100644 index 0000000000..37eebe291e --- /dev/null +++ b/third_party/snappy.BUILD @@ -0,0 +1,44 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) # BSD 3-Clause + +exports_files(["COPYING"]) + +cc_library( + name = "snappy", + srcs = [ + "snappy.cc", + "snappy.h", + "snappy-c.cc", + "snappy-c.h", + "snappy-internal.h", + "snappy-sinksource.cc", + "snappy-sinksource.h", + "snappy-stubs-internal.cc", + "snappy-stubs-internal.h", + "snappy-stubs-public.h", + ], + hdrs = ["snappy.h"], + copts = [ + "-Wno-shift-negative-value", + "-Wno-implicit-function-declaration", + ], +) + +genrule( + name = "snappy_stubs_public_h", + srcs = ["snappy-stubs-public.h.in"], + outs = ["snappy-stubs-public.h"], + cmd = ("sed " + + "-e 's/@ac_cv_have_stdint_h@/1/g' " + + "-e 's/@ac_cv_have_stddef_h@/1/g' " + + "-e 's/@ac_cv_have_stdint_h@/1/g' " + + select({ + "@%ws%//tensorflow:windows": "-e 's/@ac_cv_have_sys_uio_h@/0/g' ", + "//conditions:default": "-e 's/@ac_cv_have_sys_uio_h@/1/g' ", + }) + + "-e 's/@SNAPPY_MAJOR@/1/g' " + + "-e 's/@SNAPPY_MINOR@/1/g' " + + "-e 's/@SNAPPY_PATCHLEVEL@/4/g' " + + "$< >$@"), +) -- cgit v1.2.3