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
This commit is contained in:
agiardullo 2015-07-17 11:04:55 -07:00
parent 74c755c552
commit 79373c372d
11 changed files with 13 additions and 13 deletions

View File

@ -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"

View File

@ -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))

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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")

View File

@ -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"
/*

View File

@ -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"