From 108c9cdf6176dbc4790feb7bfb8df4262ea16b9a Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Tue, 1 Nov 2016 07:56:33 +0000 Subject: [PATCH] Convert tabs to spaces --- rocksdb-sys/Makefile | 2 +- rocksdb-sys/build.rs | 136 +++++++++++++++--------------- rocksdb-sys/snappy-stubs-public.h | 4 +- 3 files changed, 71 insertions(+), 71 deletions(-) diff --git a/rocksdb-sys/Makefile b/rocksdb-sys/Makefile index 07dc2f5..8e5405a 100644 --- a/rocksdb-sys/Makefile +++ b/rocksdb-sys/Makefile @@ -1,6 +1,6 @@ include rocksdb/src.mk rocksdb_lib_sources.txt: rocksdb/src.mk - @echo -n ${LIB_SOURCES} > rocksdb_lib_sources.txt + @echo -n ${LIB_SOURCES} > rocksdb_lib_sources.txt gen_lib_sources: rocksdb_lib_sources.txt diff --git a/rocksdb-sys/build.rs b/rocksdb-sys/build.rs index c01e035..410a5ed 100644 --- a/rocksdb-sys/build.rs +++ b/rocksdb-sys/build.rs @@ -14,45 +14,45 @@ fn link(name: &str, bundled: bool) { } fn build_rocksdb() { - let mut config = gcc::Config::new(); - config.include("rocksdb/include/"); - config.include("rocksdb/"); - config.include("rocksdb/third-party/gtest-1.7.0/fused-src/"); - config.include("snappy/"); - config.include("."); + let mut config = gcc::Config::new(); + config.include("rocksdb/include/"); + config.include("rocksdb/"); + config.include("rocksdb/third-party/gtest-1.7.0/fused-src/"); + config.include("snappy/"); + config.include("."); - config.define("NDEBUG", Some("1")); - config.define("SNAPPY", Some("1")); + config.define("NDEBUG", Some("1")); + config.define("SNAPPY", Some("1")); let mut lib_sources = include_str!("rocksdb_lib_sources.txt").split(" ").collect::>(); - // We have a pregenerated a version of build_version.cc in the local directory - lib_sources = lib_sources.iter().cloned().filter(|file| { - *file != "util/build_version.cc" - }) - .collect::>(); - - if cfg!(target_os = "macos") { - config.define("OS_MACOSX", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); - - } - if cfg!(target_os = "linux") { - config.define("OS_LINUX", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + // We have a pregenerated a version of build_version.cc in the local directory + lib_sources = lib_sources.iter().cloned().filter(|file| { + *file != "util/build_version.cc" + }) + .collect::>(); + + if cfg!(target_os = "macos") { + config.define("OS_MACOSX", Some("1")); + config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); + config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + + } + if cfg!(target_os = "linux") { + config.define("OS_LINUX", Some("1")); + config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); + config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); //COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp" - } - if cfg!(target_os = "freebsd") { - config.define("OS_FREEBSD", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); - } + } + if cfg!(target_os = "freebsd") { + config.define("OS_FREEBSD", Some("1")); + config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); + config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + } - if cfg!(windows) { - link("rpcrt4", false); - config.define("OS_WIN", Some("1")); + if cfg!(windows) { + link("rpcrt4", false); + config.define("OS_WIN", Some("1")); // Remove POSIX-specific sources lib_sources = lib_sources.iter().cloned().filter(|file| { @@ -66,51 +66,51 @@ fn build_rocksdb() { .collect::>(); // Add Windows-specific sources - lib_sources.push("port/win/port_win.cc"); - lib_sources.push("port/win/env_win.cc"); - lib_sources.push("port/win/env_default.cc"); - lib_sources.push("port/win/win_logger.cc"); - lib_sources.push("port/win/io_win.cc"); - } - - if cfg!(target_env = "msvc") { - config.flag("-EHsc"); - } else { - config.flag("-std=c++11"); - } + lib_sources.push("port/win/port_win.cc"); + lib_sources.push("port/win/env_win.cc"); + lib_sources.push("port/win/env_default.cc"); + lib_sources.push("port/win/win_logger.cc"); + lib_sources.push("port/win/io_win.cc"); + } + + if cfg!(target_env = "msvc") { + config.flag("-EHsc"); + } else { + config.flag("-std=c++11"); + } for file in lib_sources { - let file = "rocksdb/".to_string() + file; + let file = "rocksdb/".to_string() + file; config.file(&file); } - config.file("build_version.cc"); + config.file("build_version.cc"); - config.cpp(true); - config.compile("librocksdb.a"); + config.cpp(true); + config.compile("librocksdb.a"); } fn build_snappy() { - let mut config = gcc::Config::new(); - config.include("snappy/"); - config.include("."); - - config.define("NDEBUG", Some("1")); - - if cfg!(target_env = "msvc") { - config.flag("-EHsc"); - } else { - config.flag("-std=c++11"); - } - - config.file("snappy/snappy.cc"); - config.file("snappy/snappy-sinksource.cc"); - config.file("snappy/snappy-c.cc"); - config.cpp(true); - config.compile("libsnappy.a"); + let mut config = gcc::Config::new(); + config.include("snappy/"); + config.include("."); + + config.define("NDEBUG", Some("1")); + + if cfg!(target_env = "msvc") { + config.flag("-EHsc"); + } else { + config.flag("-std=c++11"); + } + + config.file("snappy/snappy.cc"); + config.file("snappy/snappy-sinksource.cc"); + config.file("snappy/snappy-c.cc"); + config.cpp(true); + config.compile("libsnappy.a"); } fn main() { - build_rocksdb(); - build_snappy(); + build_rocksdb(); + build_snappy(); } diff --git a/rocksdb-sys/snappy-stubs-public.h b/rocksdb-sys/snappy-stubs-public.h index e6f1faa..14592e0 100644 --- a/rocksdb-sys/snappy-stubs-public.h +++ b/rocksdb-sys/snappy-stubs-public.h @@ -88,8 +88,8 @@ typedef std::string string; // Windows does not have an iovec type, yet the concept is universally useful. // It is simple to define it ourselves, so we put it inside our own namespace. struct iovec { - void* iov_base; - size_t iov_len; + void* iov_base; + size_t iov_len; }; } // namespace snappy