Fix ROCKSDB_WARNING

Summary:
ROCKSDB_WARNING is only defined if either ROCKSDB_PLATFORM_POSIX or OS_WIN is defined.  This works well for building rocksdb with its own build scripts.  But this won't work when an outside project(like mongodb) doesn't define ROCKSDB_PLATFORM_POSIX.

This fix defines ROCKSDB_WARNING for all platforms.  No idea if its defined correctly on non-posix,non-windows platforms but this is no worse that the current situation where this macro is missing on unexpected platforms.

This fix should hopefully fix anyone whose build broke now that we've switched from using #warning to Pragma (to support windows).  Unfortunately, while mongo-rocks compiles, it ignores the Pragma and doesn't print a warning.  I have not been able to figure out a way to implement this portably on all platforms.

Of course, an alternate solution would be to just get rid of ROCKSDB_WARNING and live with include file redirects indefinitely.  Thoughts?

Test Plan: build rocks, build mongorocks

Reviewers: igor, kradhakrishnan, IslamAbdelRahman, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D42477
main
agiardullo 9 years ago
parent 74c755c552
commit 79373c372d
  1. 6
      include/rocksdb/utilities/convenience.h
  2. 2
      include/rocksdb/utilities/pragma_error.h
  3. 2
      include/utilities/backupable_db.h
  4. 2
      include/utilities/db_ttl.h
  5. 2
      include/utilities/document_db.h
  6. 2
      include/utilities/geo_db.h
  7. 2
      include/utilities/json_document.h
  8. 2
      include/utilities/stackable_db.h
  9. 2
      include/utilities/utility_db.h
  10. 2
      java/rocksjni/options.cc
  11. 2
      util/db_test_util.h

@ -5,8 +5,8 @@
#pragma once
// #include "utilities/pragma_error.h"
// TODO(agiardullo): need to figure out how to make this portable
// ROCKSDB_WARNING("This file was moved to rocksdb/convenience.h")
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/convenience.h")
#include "rocksdb/convenience.h"

@ -13,7 +13,7 @@
#define RDB_STR__(x) #x
#define RDB_STR(x) RDB_STR__(x)
#if defined(ROCKSDB_PLATFORM_POSIX)
#if defined(__GNUC__) || defined(__clang__)
// Wrap unportable warning macro
#define ROCKSDB_WARNING(x) _Pragma(RDB_STR(GCC warning x))

@ -9,7 +9,7 @@
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING(
"Warning: This file was moved to rocksdb/utilities/backupable_db.h")

@ -5,7 +5,7 @@
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/utilities/db_ttl.h")

@ -5,7 +5,7 @@
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/utilities/document_db.h")

@ -5,7 +5,7 @@
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/utilities/geo_db.h")

@ -4,7 +4,7 @@
// of patent rights can be found in the PATENTS file in the same directory.
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/utilities/json_document.h")

@ -3,7 +3,7 @@
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/utilities/stackable_db.h")

@ -4,7 +4,7 @@
#pragma once
#include "pragma_error.h"
#include "rocksdb/utilities/pragma_error.h"
ROCKSDB_WARNING("This file was moved to rocksdb/utilities/utility_db.h")

@ -30,8 +30,8 @@
#include "rocksdb/slice_transform.h"
#include "rocksdb/rate_limiter.h"
#include "rocksdb/comparator.h"
#include "rocksdb/convenience.h"
#include "rocksdb/merge_operator.h"
#include "rocksdb/utilities/convenience.h"
#include "utilities/merge_operators.h"
/*

@ -31,6 +31,7 @@
#include "db/filename.h"
#include "rocksdb/cache.h"
#include "rocksdb/compaction_filter.h"
#include "rocksdb/convenience.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "rocksdb/filter_policy.h"
@ -38,7 +39,6 @@
#include "rocksdb/slice.h"
#include "rocksdb/table.h"
#include "rocksdb/utilities/checkpoint.h"
#include "rocksdb/convenience.h"
#include "table/block_based_table_factory.h"
#include "table/mock_table.h"
#include "table/plain_table_factory.h"

Loading…
Cancel
Save