summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-03-25 19:17:26 -0400
committerAndrew Morrow <acm@mongodb.com>2015-03-26 10:17:08 -0400
commit06b58e9c7c349ce81504cf6ce2823082205ab0f7 (patch)
treee56a7389a28887ad11fcd80bcdf7e21cccd033ab /src
parent05533d52a29589f54ec9ee582e770a5fdda552a5 (diff)
downloadmongo-06b58e9c7c349ce81504cf6ce2823082205ab0f7.tar.gz
SERVER-17736 Remove obsolete C++ driver symbol export miscellanea
Diffstat (limited to 'src')
-rw-r--r--src/mongo/base/generate_error_codes.py3
-rw-r--r--src/mongo/base/initializer.h9
-rw-r--r--src/mongo/base/parse_number.cpp2
-rw-r--r--src/mongo/base/parse_number.h3
-rw-r--r--src/mongo/base/status.h11
-rw-r--r--src/mongo/bson/bsonelement.h3
-rw-r--r--src/mongo/bson/bsonobj.h3
-rw-r--r--src/mongo/bson/bsonobjbuilder.h3
-rw-r--r--src/mongo/client/connpool.h1
-rw-r--r--src/mongo/client/cyrus_sasl_client_session.h3
-rw-r--r--src/mongo/client/dbclient_rs.h7
-rw-r--r--src/mongo/client/dbclientcursor.h7
-rw-r--r--src/mongo/client/dbclientinterface.h51
-rw-r--r--src/mongo/client/dbclientmockcursor.h3
-rw-r--r--src/mongo/client/export_macros.h64
-rw-r--r--src/mongo/client/gridfs.h7
-rw-r--r--src/mongo/client/native_sasl_client_session.h3
-rw-r--r--src/mongo/client/parallel.h1
-rw-r--r--src/mongo/client/redef_macros.h93
-rw-r--r--src/mongo/client/replica_set_monitor.h5
-rw-r--r--src/mongo/client/sasl_client_authenticate.h41
-rw-r--r--src/mongo/client/sasl_client_session.h3
-rw-r--r--src/mongo/client/syncclusterconnection.h1
-rw-r--r--src/mongo/client/undef_macros.h77
-rw-r--r--src/mongo/db/json.h11
-rw-r--r--src/mongo/logger/logger.h3
-rw-r--r--src/mongo/logger/logstream_builder.h3
-rw-r--r--src/mongo/platform/compiler.h13
-rw-r--r--src/mongo/s/distlock.h13
-rw-r--r--src/mongo/util/assert_util.h73
-rw-r--r--src/mongo/util/concurrency/thread_name.h3
-rw-r--r--src/mongo/util/concurrency/threadlocal.h3
-rw-r--r--src/mongo/util/logfile.h3
-rw-r--r--src/mongo/util/mmap.h1
-rw-r--r--src/mongo/util/net/httpclient.h5
-rw-r--r--src/mongo/util/net/ssl_options.h5
-rw-r--r--src/mongo/util/time_support.h7
-rw-r--r--src/mongo/util/timer.h3
38 files changed, 141 insertions, 409 deletions
diff --git a/src/mongo/base/generate_error_codes.py b/src/mongo/base/generate_error_codes.py
index ad93656a7d1..f8dd6ba4317 100644
--- a/src/mongo/base/generate_error_codes.py
+++ b/src/mongo/base/generate_error_codes.py
@@ -184,7 +184,6 @@ header_template = '''// AUTO-GENERATED FILE DO NOT EDIT
#include <string>
#include "mongo/base/string_data.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -195,7 +194,7 @@ namespace mongo {
* Do not update this file directly. Update src/mongo/base/error_codes.err instead.
*/
- class MONGO_CLIENT_API ErrorCodes {
+ class ErrorCodes {
public:
enum Error {
%(error_code_enum_declarations)s,
diff --git a/src/mongo/base/initializer.h b/src/mongo/base/initializer.h
index 02c4da6a332..a8abc6603b3 100644
--- a/src/mongo/base/initializer.h
+++ b/src/mongo/base/initializer.h
@@ -34,7 +34,6 @@
#include "mongo/base/initializer_context.h"
#include "mongo/base/initializer_dependency_graph.h"
#include "mongo/base/status.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -46,7 +45,7 @@ namespace mongo {
* edges to the graph. Then, one executes the process, causing each initialization operation to
* execute in an order that respects the programmer-established prerequistes.
*/
- class MONGO_CLIENT_API Initializer {
+ class Initializer {
MONGO_DISALLOW_COPYING(Initializer);
public:
Initializer();
@@ -80,17 +79,17 @@ namespace mongo {
* This means that the few initializers that might want to terminate the program by failing
* should probably arrange to terminate the process themselves.
*/
- MONGO_CLIENT_API Status runGlobalInitializers(const InitializerContext::ArgumentVector& args,
+ Status runGlobalInitializers(const InitializerContext::ArgumentVector& args,
const InitializerContext::EnvironmentMap& env);
- MONGO_CLIENT_API Status runGlobalInitializers(
+ Status runGlobalInitializers(
int argc, const char* const* argv, const char* const* envp);
/**
* Same as runGlobalInitializers(), except prints a brief message to std::cerr
* and terminates the process on failure.
*/
- MONGO_CLIENT_API void runGlobalInitializersOrDie(
+ void runGlobalInitializersOrDie(
int argc, const char* const* argv, const char* const* envp);
} // namespace mongo
diff --git a/src/mongo/base/parse_number.cpp b/src/mongo/base/parse_number.cpp
index 4ae34a48ebc..ea3dfaccfdf 100644
--- a/src/mongo/base/parse_number.cpp
+++ b/src/mongo/base/parse_number.cpp
@@ -193,7 +193,7 @@ namespace mongo {
// Definition of the various supported implementations of parseNumberFromStringWithBase.
#define DEFINE_PARSE_NUMBER_FROM_STRING_WITH_BASE(NUMBER_TYPE) \
- template MONGO_CLIENT_API Status parseNumberFromStringWithBase<NUMBER_TYPE>(StringData, int, NUMBER_TYPE*);
+ template Status parseNumberFromStringWithBase<NUMBER_TYPE>(StringData, int, NUMBER_TYPE*);
DEFINE_PARSE_NUMBER_FROM_STRING_WITH_BASE(long)
DEFINE_PARSE_NUMBER_FROM_STRING_WITH_BASE(long long)
diff --git a/src/mongo/base/parse_number.h b/src/mongo/base/parse_number.h
index 900a0963e55..f9a5e44d1b8 100644
--- a/src/mongo/base/parse_number.h
+++ b/src/mongo/base/parse_number.h
@@ -33,7 +33,6 @@
#include "mongo/base/status.h"
#include "mongo/base/string_data.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -55,7 +54,7 @@ namespace mongo {
* See parse_number.cpp for the available instantiations, and add any new instantiations there.
*/
template <typename NumberType>
- MONGO_CLIENT_API Status parseNumberFromStringWithBase(StringData stringValue, int base, NumberType* result);
+ Status parseNumberFromStringWithBase(StringData stringValue, int base, NumberType* result);
template <typename NumberType>
static Status parseNumberFromString(StringData stringValue, NumberType* result) {
diff --git a/src/mongo/base/status.h b/src/mongo/base/status.h
index e8b82023179..2e1b73f4ddd 100644
--- a/src/mongo/base/status.h
+++ b/src/mongo/base/status.h
@@ -32,7 +32,6 @@
#include <string>
#include "mongo/base/error_codes.h"
-#include "mongo/client/export_macros.h"
#include "mongo/platform/atomic_word.h"
namespace mongo {
@@ -60,7 +59,7 @@ namespace mongo {
* TODO: generate base/error_codes.h out of a description file
* TODO: check 'location' duplicates against assert numbers
*/
- class MONGO_CLIENT_API Status {
+ class Status {
public:
// Short-hand for returning an OK status.
static inline Status OK();
@@ -145,16 +144,16 @@ namespace mongo {
static inline void unref(ErrorInfo* error);
};
- MONGO_CLIENT_API inline bool operator==(const ErrorCodes::Error lhs, const Status& rhs);
+ inline bool operator==(const ErrorCodes::Error lhs, const Status& rhs);
- MONGO_CLIENT_API inline bool operator!=(const ErrorCodes::Error lhs, const Status& rhs);
+ inline bool operator!=(const ErrorCodes::Error lhs, const Status& rhs);
//
// Convenience method for unittest code. Please use accessors otherwise.
//
- MONGO_CLIENT_API std::ostream& operator<<(std::ostream& os, const Status& status);
- MONGO_CLIENT_API std::ostream& operator<<(std::ostream& os, ErrorCodes::Error);
+ std::ostream& operator<<(std::ostream& os, const Status& status);
+ std::ostream& operator<<(std::ostream& os, ErrorCodes::Error);
} // namespace mongo
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index d31aacb69f3..b79cc19d0cd 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -37,7 +37,6 @@
#include "mongo/base/data_view.h"
#include "mongo/bson/bsontypes.h"
#include "mongo/bson/oid.h"
-#include "mongo/client/export_macros.h"
#include "mongo/platform/cstdint.h"
namespace mongo {
@@ -67,7 +66,7 @@ namespace mongo {
value()
type()
*/
- class MONGO_CLIENT_API BSONElement {
+ class BSONElement {
public:
/** These functions, which start with a capital letter, throw a MsgAssertionException if the
element is not of the required type. Example:
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h
index 4eb4f46f86a..ccb20fd59ec 100644
--- a/src/mongo/bson/bsonobj.h
+++ b/src/mongo/bson/bsonobj.h
@@ -39,7 +39,6 @@
#include "mongo/base/data_view.h"
#include "mongo/base/string_data.h"
#include "mongo/bson/util/builder.h"
-#include "mongo/client/export_macros.h"
#include "mongo/platform/atomic_word.h"
#include "mongo/util/bufreader.h"
#include "mongo/util/shared_buffer.h"
@@ -87,7 +86,7 @@ namespace mongo {
Code With Scope: <total size><String><Object>
\endcode
*/
- class MONGO_CLIENT_API BSONObj {
+ class BSONObj {
public:
/** Construct an empty BSONObj -- that is, {}. */
diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h
index 3c3cd7de363..b6e667e3322 100644
--- a/src/mongo/bson/bsonobjbuilder.h
+++ b/src/mongo/bson/bsonobjbuilder.h
@@ -46,7 +46,6 @@
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/bsonmisc.h"
#include "mongo/bson/bsonobj.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -58,7 +57,7 @@ namespace mongo {
/** Utility for creating a BSONObj.
See also the BSON() and BSON_ARRAY() macros.
*/
- class MONGO_CLIENT_API BSONObjBuilder : boost::noncopyable {
+ class BSONObjBuilder : boost::noncopyable {
public:
/** @param initsize this is just a hint as to the final size of the object */
BSONObjBuilder(int initsize=512)
diff --git a/src/mongo/client/connpool.h b/src/mongo/client/connpool.h
index e027f182301..3385e255cf3 100644
--- a/src/mongo/client/connpool.h
+++ b/src/mongo/client/connpool.h
@@ -33,7 +33,6 @@
#include <stack>
#include "mongo/client/dbclientinterface.h"
-#include "mongo/client/export_macros.h"
#include "mongo/platform/atomic_word.h"
#include "mongo/platform/cstdint.h"
#include "mongo/util/background.h"
diff --git a/src/mongo/client/cyrus_sasl_client_session.h b/src/mongo/client/cyrus_sasl_client_session.h
index 0af40978447..d24d12124c5 100644
--- a/src/mongo/client/cyrus_sasl_client_session.h
+++ b/src/mongo/client/cyrus_sasl_client_session.h
@@ -27,7 +27,6 @@
#include <boost/scoped_array.hpp>
-#include "mongo/client/export_macros.h"
#include "mongo/client/sasl_client_session.h"
#include <sasl/sasl.h>
@@ -38,7 +37,7 @@ namespace mongo {
* Implementation of the client side of a SASL authentication conversation.
* using the Cyrus SASL library.
*/
- class MONGO_CLIENT_API CyrusSaslClientSession : public SaslClientSession {
+ class CyrusSaslClientSession : public SaslClientSession {
MONGO_DISALLOW_COPYING(CyrusSaslClientSession);
public:
diff --git a/src/mongo/client/dbclient_rs.h b/src/mongo/client/dbclient_rs.h
index f5764a9be1f..c968a428827 100644
--- a/src/mongo/client/dbclient_rs.h
+++ b/src/mongo/client/dbclient_rs.h
@@ -34,7 +34,6 @@
#include <utility>
#include "mongo/client/dbclientinterface.h"
-#include "mongo/client/export_macros.h"
#include "mongo/util/net/hostandport.h"
namespace mongo {
@@ -52,7 +51,7 @@ namespace mongo {
On a failover situation, expect at least one operation to return an error (throw
an exception) before the failover is complete. Operations are not retried.
*/
- class MONGO_CLIENT_API DBClientReplicaSet : public DBClientBase {
+ class DBClientReplicaSet : public DBClientBase {
public:
using DBClientBase::query;
using DBClientBase::update;
@@ -310,7 +309,7 @@ namespace mongo {
/**
* A simple object for representing the list of tags requested by a $readPreference.
*/
- class MONGO_CLIENT_API TagSet {
+ class TagSet {
public:
/**
* Creates a TagSet that matches any nodes.
@@ -339,7 +338,7 @@ namespace mongo {
BSONArray _tags;
};
- struct MONGO_CLIENT_API ReadPreferenceSetting {
+ struct ReadPreferenceSetting {
/**
* @parm pref the read preference mode.
* @param tag the tag set. Note that this object will have the
diff --git a/src/mongo/client/dbclientcursor.h b/src/mongo/client/dbclientcursor.h
index 6eb1282a26a..53bce3056dc 100644
--- a/src/mongo/client/dbclientcursor.h
+++ b/src/mongo/client/dbclientcursor.h
@@ -33,7 +33,6 @@
#include <stack>
#include "mongo/client/dbclientinterface.h"
-#include "mongo/client/export_macros.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/json.h"
#include "mongo/util/net/message.h"
@@ -45,7 +44,7 @@ namespace mongo {
/** for mock purposes only -- do not create variants of DBClientCursor, nor hang code here
@see DBClientMockCursor
*/
- class MONGO_CLIENT_API DBClientCursorInterface : boost::noncopyable {
+ class DBClientCursorInterface : boost::noncopyable {
public:
virtual ~DBClientCursorInterface() {}
virtual bool more() = 0;
@@ -56,7 +55,7 @@ namespace mongo {
};
/** Queries return a cursor object */
- class MONGO_CLIENT_API DBClientCursor : public DBClientCursorInterface {
+ class DBClientCursor : public DBClientCursorInterface {
public:
/** If true, safe to call next(). Requests more from server if necessary. */
bool more();
@@ -259,7 +258,7 @@ namespace mongo {
/** iterate over objects in current batch only - will not cause a network call
*/
- class MONGO_CLIENT_API DBClientCursorBatchIterator {
+ class DBClientCursorBatchIterator {
public:
DBClientCursorBatchIterator( DBClientCursor &c ) : _c( c ), _n() {}
bool moreInCurrentBatch() { return _c.moreInCurrentBatch(); }
diff --git a/src/mongo/client/dbclientinterface.h b/src/mongo/client/dbclientinterface.h
index 2c2e9b86b3f..dd44199d930 100644
--- a/src/mongo/client/dbclientinterface.h
+++ b/src/mongo/client/dbclientinterface.h
@@ -37,7 +37,6 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/bson_field.h"
-#include "mongo/client/export_macros.h"
#include "mongo/db/jsobj.h"
#include "mongo/logger/log_severity.h"
#include "mongo/platform/atomic_word.h"
@@ -49,7 +48,7 @@
namespace mongo {
/** the query field 'options' can have these bits set: */
- enum MONGO_CLIENT_API QueryOptions {
+ enum QueryOptions {
/** Tailable means cursor is not closed when the last data is retrieved. rather, the cursor marks
the final object's position. you can resume using the cursor later, from where it was located,
if more data were received. Set on dbQuery and dbGetMore.
@@ -115,7 +114,7 @@ namespace mongo {
QueryOption_PartialResults,
};
- enum MONGO_CLIENT_API UpdateOptions {
+ enum UpdateOptions {
/** Upsert - that is, insert the item if no matching item is found. */
UpdateOption_Upsert = 1 << 0,
@@ -127,7 +126,7 @@ namespace mongo {
UpdateOption_Broadcast = 1 << 2
};
- enum MONGO_CLIENT_API RemoveOptions {
+ enum RemoveOptions {
/** only delete one option */
RemoveOption_JustOne = 1 << 0,
@@ -139,7 +138,7 @@ namespace mongo {
/**
* need to put in DbMesssage::ReservedOptions as well
*/
- enum MONGO_CLIENT_API InsertOptions {
+ enum InsertOptions {
/** With muli-insert keep processing inserts if one fails */
InsertOption_ContinueOnError = 1 << 0
};
@@ -147,7 +146,7 @@ namespace mongo {
/**
* Start from *top* of bits, these are generic write options that apply to all
*/
- enum MONGO_CLIENT_API WriteOptions {
+ enum WriteOptions {
/** logical writeback option */
WriteOption_FromWriteback = 1 << 31
};
@@ -158,12 +157,12 @@ namespace mongo {
// the api user, but we need these constants to disassemble/reassemble the messages correctly.
//
- enum MONGO_CLIENT_API ReservedOptions {
+ enum ReservedOptions {
Reserved_InsertOption_ContinueOnError = 1 << 0 ,
Reserved_FromWriteback = 1 << 1
};
- enum MONGO_CLIENT_API ReadPreference {
+ enum ReadPreference {
/**
* Read from primary only. All operations produce an error (throw an
* exception where applicable) if primary is unavailable. Cannot be
@@ -195,8 +194,8 @@ namespace mongo {
ReadPreference_Nearest,
};
- class MONGO_CLIENT_API DBClientBase;
- class MONGO_CLIENT_API DBClientConnection;
+ class DBClientBase;
+ class DBClientConnection;
/**
* ConnectionString handles parsing different ways to connect to mongo and determining method
@@ -215,7 +214,7 @@ namespace mongo {
* if ( ! cs.isValid() ) throw "bad: " + errmsg;
* DBClientBase * conn = cs.connect( errmsg );
*/
- class MONGO_CLIENT_API ConnectionString {
+ class ConnectionString {
public:
enum ConnectionType { INVALID , MASTER , PAIR , SET , SYNC, CUSTOM };
@@ -357,7 +356,7 @@ namespace mongo {
* controls how much a clients cares about writes
* default is NORMAL
*/
- enum MONGO_CLIENT_API WriteConcern {
+ enum WriteConcern {
W_NONE = 0 , // TODO: not every connection type fully supports this
W_NORMAL = 1
// TODO SAFE = 2
@@ -373,7 +372,7 @@ namespace mongo {
QUERY( "age" << 33 << "school" << "UCLA" ).sort("name")
QUERY( "age" << GT << 30 << LT << 50 )
*/
- class MONGO_CLIENT_API Query {
+ class Query {
public:
static const BSONField<BSONObj> ReadPrefField;
static const BSONField<std::string> ReadPrefModeField;
@@ -495,7 +494,7 @@ namespace mongo {
* Represents a full query description, including all options required for the query to be passed on
* to other hosts
*/
- class MONGO_CLIENT_API QuerySpec {
+ class QuerySpec {
std::string _ns;
int _ntoskip;
@@ -553,15 +552,15 @@ namespace mongo {
// Useful utilities for namespaces
/** @return the database name portion of an ns std::string */
- MONGO_CLIENT_API std::string nsGetDB( const std::string &ns );
+ std::string nsGetDB( const std::string &ns );
/** @return the collection name portion of an ns std::string */
- MONGO_CLIENT_API std::string nsGetCollection( const std::string &ns );
+ std::string nsGetCollection( const std::string &ns );
/**
interface that handles communication with the db
*/
- class MONGO_CLIENT_API DBConnector {
+ class DBConnector {
public:
virtual ~DBConnector() {}
/** actualServer is set to the actual server where they call went if there was a choice (SlaveOk) */
@@ -580,7 +579,7 @@ namespace mongo {
/**
The interface that any db connection should implement
*/
- class MONGO_CLIENT_API DBClientInterface : boost::noncopyable {
+ class DBClientInterface : boost::noncopyable {
public:
virtual std::auto_ptr<DBClientCursor> query(const std::string &ns, Query query, int nToReturn = 0, int nToSkip = 0,
const BSONObj *fieldsToReturn = 0, int queryOptions = 0 , int batchSize = 0 ) = 0;
@@ -623,7 +622,7 @@ namespace mongo {
DB "commands"
Basically just invocations of connection.$cmd.findOne({...});
*/
- class MONGO_CLIENT_API DBClientWithCommands : public DBClientInterface {
+ class DBClientWithCommands : public DBClientInterface {
std::set<std::string> _seenIndexes;
public:
/** controls how chatty the client is about network errors & such. See log.h */
@@ -1090,7 +1089,7 @@ namespace mongo {
/**
abstract class that implements the core db operations
*/
- class MONGO_CLIENT_API DBClientBase : public DBClientWithCommands, public DBConnector {
+ class DBClientBase : public DBClientWithCommands, public DBConnector {
protected:
static AtomicInt64 ConnectionIdSequence;
long long _connectionId; // unique connection id for this connection
@@ -1219,7 +1218,7 @@ namespace mongo {
class DBClientReplicaSet;
- class MONGO_CLIENT_API ConnectException : public UserException {
+ class ConnectException : public UserException {
public:
ConnectException(std::string msg) : UserException(9000,msg) { }
};
@@ -1228,7 +1227,7 @@ namespace mongo {
A basic connection to the database.
This is the main entry point for talking to a simple Mongo setup
*/
- class MONGO_CLIENT_API DBClientConnection : public DBClientBase {
+ class DBClientConnection : public DBClientBase {
public:
using DBClientBase::query;
@@ -1385,12 +1384,12 @@ namespace mongo {
/** pings server to check if it's up
*/
- MONGO_CLIENT_API bool serverAlive( const std::string &uri );
+ bool serverAlive( const std::string &uri );
- MONGO_CLIENT_API BSONElement getErrField( const BSONObj& result );
- MONGO_CLIENT_API bool hasErrField( const BSONObj& result );
+ BSONElement getErrField( const BSONObj& result );
+ bool hasErrField( const BSONObj& result );
- MONGO_CLIENT_API inline std::ostream& operator<<( std::ostream &s, const Query &q ) {
+ inline std::ostream& operator<<( std::ostream &s, const Query &q ) {
return s << q.toString();
}
diff --git a/src/mongo/client/dbclientmockcursor.h b/src/mongo/client/dbclientmockcursor.h
index 4acd24e84bb..6bd7ee13413 100644
--- a/src/mongo/client/dbclientmockcursor.h
+++ b/src/mongo/client/dbclientmockcursor.h
@@ -30,11 +30,10 @@
#pragma once
#include "mongo/client/dbclientcursor.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
- class MONGO_CLIENT_API DBClientMockCursor : public DBClientCursorInterface {
+ class DBClientMockCursor : public DBClientCursorInterface {
public:
DBClientMockCursor( const BSONArray& mockCollection ) : _iter( mockCollection ) {}
virtual ~DBClientMockCursor() {}
diff --git a/src/mongo/client/export_macros.h b/src/mongo/client/export_macros.h
deleted file mode 100644
index 1926b43e138..00000000000
--- a/src/mongo/client/export_macros.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright 2013 10gen Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the GNU Affero General Public License in all respects
- * for all of the code used other than as permitted herein. If you modify
- * file(s) with this exception, you may extend this exception to your
- * version of the file(s), but you are not obligated to do so. If you do not
- * wish to do so, delete this exception statement from your version. If you
- * delete this exception statement from all source files in the program,
- * then also delete it in the license file.
- */
-
-#pragma once
-
-#include "mongo/platform/compiler.h"
-
-/**
- * Definition of macros used to label the mongo client api.
- *
- * If a type, free function or global variable is part of the client api, it must be labeled.
- *
- * To label a type, place the MONGO_CLIENT_API macro after the struct, class or enum keyword.
- * Example:
- * class MONGO_CLIENT_API DBClientInterface { ... };
- *
- * To label a function, place the label on the declaration before the return type. You
- * do NOT need to label the methods of exported classes.
- * Example:
- * MONGO_CLIENT_API Status myFreeFunction(int arg1);
- *
- * To label a global variable, place the label on the declaration, before the type and
- * after the "extern" keyword.
- * Example:
- * extern MONGO_CLIENT_API int myGlobalVariable;
- *
- * dbclient.h sets the LIBMONGOCLIENT_CONSUMER macro, so all clients will convert the
- * MONGO_CLIENT_API macro to the the import form, while the library code will convert it to the
- * export form.
- */
-
-#if defined(LIBMONGOCLIENT_CONSUMER) && !defined(LIBMONGOCLIENT_BUILDING)
-#define MONGO_CLIENT_API MONGO_COMPILER_API_IMPORT
-#elif !defined(LIBMONGOCLIENT_CONSUMER) && defined(LIBMONGOCLIENT_BUILDING)
-#define MONGO_CLIENT_API MONGO_COMPILER_API_EXPORT
-#elif !defined(LIBMONGOCLIENT_CONSUMER) && !defined(LIBMONGOCLIENT_BUILDING)
-#define MONGO_CLIENT_API
-#else
-#error "Must not define both LIBMONGOCLIENT_BUILDING and LIBMONGOCLIENT_CONSUMER"
-#endif
diff --git a/src/mongo/client/gridfs.h b/src/mongo/client/gridfs.h
index 952b14b3cc7..8646264e764 100644
--- a/src/mongo/client/gridfs.h
+++ b/src/mongo/client/gridfs.h
@@ -32,7 +32,6 @@
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/client/dbclientinterface.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -41,7 +40,7 @@ namespace mongo {
class GridFS;
class GridFile;
- class MONGO_CLIENT_API GridFSChunk {
+ class GridFSChunk {
public:
GridFSChunk( BSONObj data );
GridFSChunk( BSONObj fileId , int chunkNumber , const char * data , int len );
@@ -66,7 +65,7 @@ namespace mongo {
GridFS is for storing large file-style objects in MongoDB.
@see http://dochub.mongodb.org/core/gridfsspec
*/
- class MONGO_CLIENT_API GridFS {
+ class GridFS {
public:
/**
* @param client - db connection
@@ -149,7 +148,7 @@ namespace mongo {
/**
wrapper for a file stored in the Mongo database
*/
- class MONGO_CLIENT_API GridFile {
+ class GridFile {
public:
/**
* @return whether or not this file exists
diff --git a/src/mongo/client/native_sasl_client_session.h b/src/mongo/client/native_sasl_client_session.h
index 431460481d9..0849c463a78 100644
--- a/src/mongo/client/native_sasl_client_session.h
+++ b/src/mongo/client/native_sasl_client_session.h
@@ -27,7 +27,6 @@
#include <boost/scoped_ptr.hpp>
-#include "mongo/client/export_macros.h"
#include "mongo/client/sasl_client_session.h"
namespace mongo {
@@ -38,7 +37,7 @@ namespace mongo {
* Implementation of the client side of a SASL authentication conversation using the
* native SASL implementation.
*/
- class MONGO_CLIENT_API NativeSaslClientSession : public SaslClientSession {
+ class NativeSaslClientSession : public SaslClientSession {
MONGO_DISALLOW_COPYING(NativeSaslClientSession);
public:
diff --git a/src/mongo/client/parallel.h b/src/mongo/client/parallel.h
index d202e703751..e816e0e3ccd 100644
--- a/src/mongo/client/parallel.h
+++ b/src/mongo/client/parallel.h
@@ -36,7 +36,6 @@
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#include "mongo/client/export_macros.h"
#include "mongo/db/matcher/matcher.h"
#include "mongo/db/namespace_string.h"
#include "mongo/s/client/shard_connection.h"
diff --git a/src/mongo/client/redef_macros.h b/src/mongo/client/redef_macros.h
deleted file mode 100644
index 7706bcfb075..00000000000
--- a/src/mongo/client/redef_macros.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file redef_macros.h macros for mongo internals
-
- @see undef_macros.h undefines these after use to minimize name pollution.
-*/
-
-/* Copyright 2009 10gen Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the GNU Affero General Public License in all respects
- * for all of the code used other than as permitted herein. If you modify
- * file(s) with this exception, you may extend this exception to your
- * version of the file(s), but you are not obligated to do so. If you do not
- * wish to do so, delete this exception statement from your version. If you
- * delete this exception statement from all source files in the program,
- * then also delete it in the license file.
- */
-
-// If you define a new global un-prefixed macro, please add it here and in undef_macros
-
-#define MONGO_MACROS_PUSHED 1
-
-// util/assert_util.h
-#pragma push_macro("verify")
-#undef verify
-#define verify(expression) MONGO_verify(expression)
-#pragma push_macro("invariant")
-#undef invariant
-#define invariant MONGO_invariant
-#pragma push_macro("invariantOK")
-#undef invariantOK
-#define invariantOK MONGO_invariantOK
-#pragma push_macro("dassert")
-#undef dassert
-#define dassert MONGO_dassert
-#pragma push_macro("wassert")
-#undef wassert
-#define wassert MONGO_wassert
-#pragma push_macro("massert")
-#undef massert
-#define massert MONGO_massert
-#pragma push_macro("uassert")
-#undef uassert
-#define uassert MONGO_uassert
-#pragma push_macro("DESTRUCTOR_GUARD")
-#undef DESTRUCTOR_GUARD
-#define DESTRUCTOR_GUARD MONGO_DESTRUCTOR_GUARD
-
-// util/print.h
-#pragma push_macro("PRINT")
-#undef PRINT
-#define PRINT MONGO_PRINT
-#pragma push_macro("PRINTFL")
-#undef PRINTFL
-#define PRINTFL MONGO_PRINTFL
-
-// util/debug_util.h
-#pragma push_macro("DEV")
-#undef DEV
-#define DEV MONGO_DEV
-#pragma push_macro("SOMETIMES")
-#undef SOMETIMES
-#define SOMETIMES MONGO_SOMETIMES
-#pragma push_macro("OCCASIONALLY")
-#undef OCCASIONALLY
-#define OCCASIONALLY MONGO_OCCASIONALLY
-#pragma push_macro("RARELY")
-#undef RARELY
-#define RARELY MONGO_RARELY
-#pragma push_macro("ONCE")
-#undef ONCE
-#define ONCE MONGO_ONCE
-
-// util/log.h
-#pragma push_macro("LOG")
-#undef LOG
-#define LOG MONGO_LOG
-
-
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h
index 3c768d60c04..d8a1e3fcc34 100644
--- a/src/mongo/client/replica_set_monitor.h
+++ b/src/mongo/client/replica_set_monitor.h
@@ -33,7 +33,6 @@
#include "mongo/base/disallow_copying.h"
#include "mongo/base/string_data.h"
-#include "mongo/client/export_macros.h"
#include "mongo/stdx/functional.h"
#include "mongo/util/net/hostandport.h"
@@ -48,7 +47,7 @@ namespace mongo {
* Holds state about a replica set and provides a means to refresh the local view.
* All methods perform the required synchronization to allow callers from multiple threads.
*/
- class MONGO_CLIENT_API ReplicaSetMonitor {
+ class ReplicaSetMonitor {
MONGO_DISALLOW_COPYING(ReplicaSetMonitor);
public:
class Refresher;
@@ -228,7 +227,7 @@ namespace mongo {
* All logic related to choosing the hosts to contact and updating the SetState based on replies
* lives in this class.
*/
- class MONGO_CLIENT_API ReplicaSetMonitor::Refresher {
+ class ReplicaSetMonitor::Refresher {
public:
/**
* Contact hosts in the set to refresh our view, but stop once a host matches criteria.
diff --git a/src/mongo/client/sasl_client_authenticate.h b/src/mongo/client/sasl_client_authenticate.h
index e12649bee95..fe9e5918781 100644
--- a/src/mongo/client/sasl_client_authenticate.h
+++ b/src/mongo/client/sasl_client_authenticate.h
@@ -30,7 +30,6 @@
#include "mongo/base/status.h"
#include "mongo/bson/bsontypes.h"
#include "mongo/client/dbclientinterface.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
class BSONObj;
@@ -67,7 +66,7 @@ namespace mongo {
* rejected. Other failures, all of which are tantamount to authentication failure, may also be
* returned.
*/
- extern MONGO_CLIENT_API Status (*saslClientAuthenticate)(DBClientWithCommands* client,
+ extern Status (*saslClientAuthenticate)(DBClientWithCommands* client,
const BSONObj& saslParameters);
/**
@@ -79,69 +78,69 @@ namespace mongo {
* stores into "*payload". If the type is BinData, the contents are stored directly
* into "*payload". In all other cases, returns
*/
- Status MONGO_CLIENT_API saslExtractPayload(const BSONObj& cmdObj, std::string* payload, BSONType* type);
+ Status saslExtractPayload(const BSONObj& cmdObj, std::string* payload, BSONType* type);
// Constants
/// std::string name of the saslStart command.
- extern MONGO_CLIENT_API const char* const saslStartCommandName;
+ extern const char* const saslStartCommandName;
/// std::string name of the saslContinue command.
- extern MONGO_CLIENT_API const char* const saslContinueCommandName;
+ extern const char* const saslContinueCommandName;
/// Name of the saslStart parameter indicating that the server should automatically grant the
/// connection all privileges associated with the user after successful authentication.
- extern MONGO_CLIENT_API const char* const saslCommandAutoAuthorizeFieldName;
+ extern const char* const saslCommandAutoAuthorizeFieldName;
/// Name of the field contain the status code in responses from the server.
- extern MONGO_CLIENT_API const char* const saslCommandCodeFieldName;
+ extern const char* const saslCommandCodeFieldName;
/// Name of the field containing the conversation identifier in server respones and saslContinue
/// commands.
- extern MONGO_CLIENT_API const char* const saslCommandConversationIdFieldName;
+ extern const char* const saslCommandConversationIdFieldName;
/// Name of the field that indicates whether or not the server believes authentication has
/// completed successfully.
- extern MONGO_CLIENT_API const char* const saslCommandDoneFieldName;
+ extern const char* const saslCommandDoneFieldName;
/// Field in which to store error messages associated with non-success return codes.
- extern MONGO_CLIENT_API const char* const saslCommandErrmsgFieldName;
+ extern const char* const saslCommandErrmsgFieldName;
/// Name of parameter to saslStart command indiciating the client's desired sasl mechanism.
- extern MONGO_CLIENT_API const char* const saslCommandMechanismFieldName;
+ extern const char* const saslCommandMechanismFieldName;
/// In the event that saslStart supplies an unsupported mechanism, the server responds with a
/// field by this name, with a list of supported mechanisms.
- extern MONGO_CLIENT_API const char* const saslCommandMechanismListFieldName;
+ extern const char* const saslCommandMechanismListFieldName;
/// Field containing password information for saslClientAuthenticate().
- extern MONGO_CLIENT_API const char* const saslCommandPasswordFieldName;
+ extern const char* const saslCommandPasswordFieldName;
/// Field containing sasl payloads passed to and from the server.
- extern MONGO_CLIENT_API const char* const saslCommandPayloadFieldName;
+ extern const char* const saslCommandPayloadFieldName;
/// Field containing the std::string identifier of the user to authenticate in
/// saslClientAuthenticate().
- extern MONGO_CLIENT_API const char* const saslCommandUserFieldName;
+ extern const char* const saslCommandUserFieldName;
/// Field containing the std::string identifier of the database containing credential information,
/// or "$external" if the credential information is stored outside of the mongo cluster.
- extern MONGO_CLIENT_API const char* const saslCommandUserDBFieldName;
+ extern const char* const saslCommandUserDBFieldName;
/// Field overriding the FQDN of the hostname hosting the mongodb srevice in
/// saslClientAuthenticate().
- extern MONGO_CLIENT_API const char* const saslCommandServiceHostnameFieldName;
+ extern const char* const saslCommandServiceHostnameFieldName;
/// Field overriding the name of the mongodb service saslClientAuthenticate().
- extern MONGO_CLIENT_API const char* const saslCommandServiceNameFieldName;
+ extern const char* const saslCommandServiceNameFieldName;
/// Default database against which sasl authentication commands should run.
- extern MONGO_CLIENT_API const char* const saslDefaultDBName;
+ extern const char* const saslDefaultDBName;
/// Default sasl service name, "mongodb".
- extern MONGO_CLIENT_API const char* const saslDefaultServiceName;
+ extern const char* const saslDefaultServiceName;
// Field whose value should be set to true if the field in saslCommandPasswordFieldName needs to
// be digested.
- extern MONGO_CLIENT_API const char* const saslCommandDigestPasswordFieldName;
+ extern const char* const saslCommandDigestPasswordFieldName;
}
diff --git a/src/mongo/client/sasl_client_session.h b/src/mongo/client/sasl_client_session.h
index 61810614b9e..4bb6c9b72ba 100644
--- a/src/mongo/client/sasl_client_session.h
+++ b/src/mongo/client/sasl_client_session.h
@@ -33,7 +33,6 @@
#include "mongo/base/disallow_copying.h"
#include "mongo/base/status.h"
#include "mongo/base/string_data.h"
-#include "mongo/client/export_macros.h"
#include "mongo/stdx/functional.h"
namespace mongo {
@@ -51,7 +50,7 @@ namespace mongo {
* parameters must be UTF-8 encoded strings with no embedded NUL characters. The
* parameterPassword parameter is not constrained.
*/
- class MONGO_CLIENT_API SaslClientSession {
+ class SaslClientSession {
MONGO_DISALLOW_COPYING(SaslClientSession);
public:
typedef stdx::function<SaslClientSession* (const std::string&)> SaslClientSessionFactoryFn;
diff --git a/src/mongo/client/syncclusterconnection.h b/src/mongo/client/syncclusterconnection.h
index 6a99f59a364..1f8d336318d 100644
--- a/src/mongo/client/syncclusterconnection.h
+++ b/src/mongo/client/syncclusterconnection.h
@@ -35,7 +35,6 @@
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/client/dbclientinterface.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
diff --git a/src/mongo/client/undef_macros.h b/src/mongo/client/undef_macros.h
deleted file mode 100644
index 13f160bed22..00000000000
--- a/src/mongo/client/undef_macros.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file undef_macros.h remove mongo implementation macros after using */
-
-/* Copyright 2009 10gen Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the GNU Affero General Public License in all respects
- * for all of the code used other than as permitted herein. If you modify
- * file(s) with this exception, you may extend this exception to your
- * version of the file(s), but you are not obligated to do so. If you do not
- * wish to do so, delete this exception statement from your version. If you
- * delete this exception statement from all source files in the program,
- * then also delete it in the license file.
- */
-
-// If you define a new global un-prefixed macro, please add it here and in redef_macros
-
-// #pragma once // this file is intended to be processed multiple times
-
-#ifdef MONGO_MACROS_PUSHED
-
-// util/assert_util.h
-#undef dassert
-#pragma pop_macro("dassert")
-#undef wassert
-#pragma pop_macro("wassert")
-#undef massert
-#pragma pop_macro("massert")
-#undef uassert
-#pragma pop_macro("uassert")
-#undef verify
-#pragma pop_macro("verify")
-#undef invariant
-#pragma pop_macro("invariant")
-#undef invariantOK
-#pragma pop_macro("invariantOK")
-#undef DESTRUCTOR_GUARD
-#pragma pop_macro("DESTRUCTOR_GUARD")
-
-// util/print.h
-#undef PRINT
-#pragma pop_macro("PRINT")
-#undef PRINTFL
-#pragma pop_macro("PRINTFL")
-
-// util/debug_util.h
-#undef DEV
-#pragma pop_macro("DEV")
-#undef SOMETIMES
-#pragma pop_macro("SOMETIMES")
-#undef OCCASIONALLY
-#pragma pop_macro("OCCASIONALLY")
-#undef RARELY
-#pragma pop_macro("RARELY")
-#undef ONCE
-#pragma pop_macro("ONCE")
-
-// util/log.h
-#undef LOG
-#pragma pop_macro("LOG")
-
-#undef MONGO_MACROS_PUSHED
-#endif
diff --git a/src/mongo/db/json.h b/src/mongo/db/json.h
index 0d18eaee68d..34564765242 100644
--- a/src/mongo/db/json.h
+++ b/src/mongo/db/json.h
@@ -32,7 +32,6 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/base/status.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -49,10 +48,10 @@ namespace mongo {
* @throws MsgAssertionException if parsing fails. The message included with
* this assertion includes the character offset where parsing failed.
*/
- MONGO_CLIENT_API BSONObj fromjson(const std::string& str);
+ BSONObj fromjson(const std::string& str);
/** @param len will be size of JSON object in text chars. */
- MONGO_CLIENT_API BSONObj fromjson(const char* str, int* len=NULL);
+ BSONObj fromjson(const char* str, int* len=NULL);
/**
* Tests whether the JSON string is an Array.
@@ -68,7 +67,7 @@ namespace mongo {
*
* @param obj The JSON string to test.
*/
- MONGO_CLIENT_API bool isArray(StringData str);
+ bool isArray(StringData str);
/**
* Convert a BSONArray to a JSON string.
@@ -77,7 +76,7 @@ namespace mongo {
* @param format The JSON format (JS, TenGen, Strict).
* @param pretty Enables pretty output.
*/
- MONGO_CLIENT_API std::string tojson(
+ std::string tojson(
const BSONArray& arr,
JsonStringFormat format = Strict,
bool pretty = false
@@ -90,7 +89,7 @@ namespace mongo {
* @param format The JSON format (JS, TenGen, Strict).
* @param pretty Enables pretty output.
*/
- MONGO_CLIENT_API std::string tojson(
+ std::string tojson(
const BSONObj& obj,
JsonStringFormat format = Strict,
bool pretty = false
diff --git a/src/mongo/logger/logger.h b/src/mongo/logger/logger.h
index 29f8de3e833..fc1e034d316 100644
--- a/src/mongo/logger/logger.h
+++ b/src/mongo/logger/logger.h
@@ -27,7 +27,6 @@
#pragma once
-#include "mongo/client/export_macros.h"
#include "mongo/logger/message_log_domain.h"
#include "mongo/logger/log_manager.h"
#include "mongo/logger/rotatable_file_manager.h"
@@ -43,7 +42,7 @@ namespace logger {
/**
* Gets a global singleton instance of LogManager.
*/
- MONGO_CLIENT_API LogManager* globalLogManager();
+ LogManager* globalLogManager();
/**
* Gets the global MessageLogDomain associated for the global log manager.
diff --git a/src/mongo/logger/logstream_builder.h b/src/mongo/logger/logstream_builder.h
index fcef56d7b91..1b76178c377 100644
--- a/src/mongo/logger/logstream_builder.h
+++ b/src/mongo/logger/logstream_builder.h
@@ -31,7 +31,6 @@
#include <sstream>
#include <string>
-#include "mongo/client/export_macros.h"
#include "mongo/logger/labeled_level.h"
#include "mongo/logger/log_component.h"
#include "mongo/logger/log_severity.h"
@@ -46,7 +45,7 @@ namespace logger {
/**
* Stream-ish object used to build and append log messages.
*/
- class MONGO_CLIENT_API LogstreamBuilder {
+ class LogstreamBuilder {
public:
static LogSeverity severityCast(int ll) { return LogSeverity::cast(ll); }
static LogSeverity severityCast(LogSeverity ls) { return ls; }
diff --git a/src/mongo/platform/compiler.h b/src/mongo/platform/compiler.h
index 75882011096..f4868acf432 100644
--- a/src/mongo/platform/compiler.h
+++ b/src/mongo/platform/compiler.h
@@ -95,12 +95,13 @@
* class MONGO_COMPILER_API_EXPORT ExportedType { ... };
* MONGO_COMPILER_API_EXPORT SomeType exportedFunction(...);
*
- * NOTE: Rather than using this macro directly, one typically declares another macro named for the
- * library, which is conditionally defined to either MONGO_COMIPLER_API_EXPORT or
- * MONGO_COMPILER_API_IMPORT based on whether the compiler is currently building the library or
- * building an object that depends on the library, respectively. For example, MONGO_CLIENT_API
- * might be defined to MONGO_COMPILER_API_EXPORT when building the MongoDB shared library, and to
- * MONGO_COMPILER_API_IMPORT when building an application that links against the shared library.
+ * NOTE: Rather than using this macro directly, one typically declares another macro named
+ * for the library, which is conditionally defined to either MONGO_COMIPLER_API_EXPORT or
+ * MONGO_COMPILER_API_IMPORT based on whether the compiler is currently building the library
+ * or building an object that depends on the library, respectively. For example,
+ * MONGO_FOO_API might be defined to MONGO_COMPILER_API_EXPORT when building the MongoDB
+ * libfoo shared library, and to MONGO_COMPILER_API_IMPORT when building an application that
+ * links against that shared library.
*
*
* MONGO_COMPILER_API_IMPORT
diff --git a/src/mongo/s/distlock.h b/src/mongo/s/distlock.h
index ec90cda85c2..546b3135a40 100644
--- a/src/mongo/s/distlock.h
+++ b/src/mongo/s/distlock.h
@@ -31,7 +31,6 @@
#include "mongo/platform/basic.h"
#include "mongo/client/connpool.h"
-#include "mongo/client/export_macros.h"
#include "mongo/client/syncclusterconnection.h"
#include "mongo/logger/labeled_level.h"
@@ -59,7 +58,7 @@ namespace mongo {
/**
* Exception class to encapsulate exceptions while managing distributed locks
*/
- class MONGO_CLIENT_API LockException : public DBException {
+ class LockException : public DBException {
public:
LockException( const char * msg , int code ) : DBException( msg, code ) {}
LockException( const std::string& msg, int code ) : DBException( msg, code ) {}
@@ -69,7 +68,7 @@ namespace mongo {
/**
* Indicates an error in retrieving time values from remote servers.
*/
- class MONGO_CLIENT_API TimeNotFoundException : public LockException {
+ class TimeNotFoundException : public LockException {
public:
TimeNotFoundException( const char * msg , int code ) : LockException( msg, code ) {}
TimeNotFoundException( const std::string& msg, int code ) : LockException( msg, code ) {}
@@ -104,7 +103,7 @@ namespace mongo {
* Note that at any point in time, a lock can be force unlocked if the ping for the lock
* becomes too stale.
*/
- class MONGO_CLIENT_API DistributedLock {
+ class DistributedLock {
public:
static logger::LabeledLevel logLvl;
@@ -232,15 +231,15 @@ namespace mongo {
// Helper functions for tests, allows us to turn the creation of a lock pinger on and off.
// *NOT* thread-safe
- bool MONGO_CLIENT_API isLockPingerEnabled();
- void MONGO_CLIENT_API setLockPingerEnabled(bool enabled);
+ bool isLockPingerEnabled();
+ void setLockPingerEnabled(bool enabled);
/**
* Scoped wrapper for a distributed lock acquisition attempt. One or more attempts to acquire
* the distributed lock are managed by this class, and the distributed lock is unlocked if
* successfully acquired on object destruction.
*/
- class MONGO_CLIENT_API ScopedDistributedLock {
+ class ScopedDistributedLock {
public:
static const long long kDefaultLockTryIntervalMillis;
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h
index b3857744888..17e00082b77 100644
--- a/src/mongo/util/assert_util.h
+++ b/src/mongo/util/assert_util.h
@@ -33,7 +33,6 @@
#include <string>
#include "mongo/base/status.h" // NOTE: This is safe as utils depend on base
-#include "mongo/client/export_macros.h"
#include "mongo/platform/compiler.h"
#include "mongo/logger/log_severity.h"
#include "mongo/logger/logger.h"
@@ -54,7 +53,7 @@ namespace mongo {
NotMaster = 10107, // uassert( 10107 )
};
- class MONGO_CLIENT_API AssertionCount {
+ class AssertionCount {
public:
AssertionCount();
void rollover();
@@ -71,7 +70,7 @@ namespace mongo {
class BSONObjBuilder;
- struct MONGO_CLIENT_API ExceptionInfo {
+ struct ExceptionInfo {
ExceptionInfo() : msg(""),code(-1) {}
ExceptionInfo( const char * m , int c )
: msg( m ) , code( c ) {
@@ -93,7 +92,7 @@ namespace mongo {
example:
throw UserException(123, ErrorMsg("blah", num_val));
*/
- class MONGO_CLIENT_API ErrorMsg {
+ class ErrorMsg {
public:
ErrorMsg(const char *msg, char ch);
ErrorMsg(const char *msg, unsigned val);
@@ -103,11 +102,11 @@ namespace mongo {
};
class DBException;
- MONGO_CLIENT_API std::string causedBy( const DBException& e );
- MONGO_CLIENT_API std::string causedBy( const std::string& e );
+ std::string causedBy( const DBException& e );
+ std::string causedBy( const std::string& e );
/** Most mongo exceptions inherit from this; this is commonly caught in most threads */
- class MONGO_CLIENT_API DBException : public std::exception {
+ class DBException : public std::exception {
public:
DBException( const ExceptionInfo& ei ) : _ei(ei) { traceIfNeeded(*this); }
DBException( const char * msg , int code ) : _ei(msg,code) { traceIfNeeded(*this); }
@@ -146,7 +145,7 @@ namespace mongo {
ExceptionInfo _ei;
};
- class MONGO_CLIENT_API AssertionException : public DBException {
+ class AssertionException : public DBException {
public:
AssertionException( const ExceptionInfo& ei ) : DBException(ei) {}
@@ -160,7 +159,7 @@ namespace mongo {
};
/* UserExceptions are valid errors that a user can cause, like out of disk space or duplicate key */
- class MONGO_CLIENT_API UserException : public AssertionException {
+ class UserException : public AssertionException {
public:
UserException(int c , const std::string& m) : AssertionException( m , c ) {}
virtual bool severe() const { return false; }
@@ -168,7 +167,7 @@ namespace mongo {
virtual void appendPrefix( std::stringstream& ss ) const;
};
- class MONGO_CLIENT_API MsgAssertionException : public AssertionException {
+ class MsgAssertionException : public AssertionException {
public:
MsgAssertionException( const ExceptionInfo& ei ) : AssertionException( ei ) {}
MsgAssertionException(int c, const std::string& m) : AssertionException( m , c ) {}
@@ -176,51 +175,51 @@ namespace mongo {
virtual void appendPrefix( std::stringstream& ss ) const;
};
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void verifyFailed(const char* expr, const char* file, unsigned line);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void invariantFailed(const char* expr, const char* file, unsigned line);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void invariantOKFailed(const char* expr, const Status& status, const char *file, unsigned line);
- MONGO_CLIENT_API void wasserted(const char* expr, const char* file, unsigned line);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void fassertFailed( int msgid );
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void fassertFailedNoTrace( int msgid );
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void fassertFailedWithStatus(
+ MONGO_COMPILER_NORETURN void verifyFailed(const char* expr, const char* file, unsigned line);
+ MONGO_COMPILER_NORETURN void invariantFailed(const char* expr, const char* file, unsigned line);
+ MONGO_COMPILER_NORETURN void invariantOKFailed(const char* expr, const Status& status, const char *file, unsigned line);
+ void wasserted(const char* expr, const char* file, unsigned line);
+ MONGO_COMPILER_NORETURN void fassertFailed( int msgid );
+ MONGO_COMPILER_NORETURN void fassertFailedNoTrace( int msgid );
+ MONGO_COMPILER_NORETURN void fassertFailedWithStatus(
int msgid, const Status& status);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void fassertFailedWithStatusNoTrace(
+ MONGO_COMPILER_NORETURN void fassertFailedWithStatusNoTrace(
int msgid, const Status& status);
/** a "user assertion". throws UserAssertion. logs. typically used for errors that a user
could cause, such as duplicate key, disk full, etc.
*/
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void uasserted(int msgid, const char *msg);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void uasserted(int msgid , const std::string &msg);
+ MONGO_COMPILER_NORETURN void uasserted(int msgid, const char *msg);
+ MONGO_COMPILER_NORETURN void uasserted(int msgid , const std::string &msg);
/** msgassert and massert are for errors that are internal but have a well defined error text
std::string. a stack trace is logged.
*/
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void msgassertedNoTrace(int msgid, const char *msg);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void msgassertedNoTrace(int msgid, const std::string &msg);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void msgasserted(int msgid, const char *msg);
- MONGO_CLIENT_API MONGO_COMPILER_NORETURN void msgasserted(int msgid, const std::string &msg);
+ MONGO_COMPILER_NORETURN void msgassertedNoTrace(int msgid, const char *msg);
+ MONGO_COMPILER_NORETURN void msgassertedNoTrace(int msgid, const std::string &msg);
+ MONGO_COMPILER_NORETURN void msgasserted(int msgid, const char *msg);
+ MONGO_COMPILER_NORETURN void msgasserted(int msgid, const std::string &msg);
/* convert various types of exceptions to strings */
- MONGO_CLIENT_API std::string causedBy( const char* e );
- MONGO_CLIENT_API std::string causedBy( const DBException& e );
- MONGO_CLIENT_API std::string causedBy( const std::exception& e );
- MONGO_CLIENT_API std::string causedBy( const std::string& e );
- MONGO_CLIENT_API std::string causedBy( const std::string* e );
- MONGO_CLIENT_API std::string causedBy( const Status& e );
+ std::string causedBy( const char* e );
+ std::string causedBy( const DBException& e );
+ std::string causedBy( const std::exception& e );
+ std::string causedBy( const std::string& e );
+ std::string causedBy( const std::string* e );
+ std::string causedBy( const Status& e );
/** aborts on condition failure */
- MONGO_CLIENT_API inline void fassert(int msgid, bool testOK) {
+ inline void fassert(int msgid, bool testOK) {
if (MONGO_unlikely(!testOK)) fassertFailed(msgid);
}
- MONGO_CLIENT_API inline void fassert(int msgid, const Status& status) {
+ inline void fassert(int msgid, const Status& status) {
if (MONGO_unlikely(!status.isOK())) {
fassertFailedWithStatus(msgid, status);
}
}
- MONGO_CLIENT_API inline void fassertNoTrace(int msgid, const Status& status) {
+ inline void fassertNoTrace(int msgid, const Status& status) {
if (MONGO_unlikely(!status.isOK())) {
fassertFailedWithStatusNoTrace(msgid, status);
}
@@ -234,7 +233,7 @@ namespace mongo {
} \
} while (false)
- MONGO_CLIENT_API inline void uassertStatusOK(const Status& status) {
+ inline void uassertStatusOK(const Status& status) {
if (MONGO_unlikely(!status.isOK())) {
uasserted((status.location() != 0 ? status.location() : status.code()),
status.reason());
@@ -242,7 +241,7 @@ namespace mongo {
}
template<typename T>
- MONGO_CLIENT_API inline T uassertStatusOK(StatusWith<T> sw) {
+ inline T uassertStatusOK(StatusWith<T> sw) {
if (MONGO_unlikely(!sw.isOK())) {
const auto& status = sw.getStatus();
uasserted((status.location() != 0 ? status.location() : status.code()),
@@ -269,14 +268,14 @@ namespace mongo {
} \
} while (false)
- MONGO_CLIENT_API inline void massertStatusOK(const Status& status) {
+ inline void massertStatusOK(const Status& status) {
if (MONGO_unlikely(!status.isOK())) {
msgasserted((status.location() != 0 ? status.location() : status.code()),
status.reason());
}
}
- MONGO_CLIENT_API inline void massertNoTraceStatusOK(const Status& status) {
+ inline void massertNoTraceStatusOK(const Status& status) {
if (MONGO_unlikely(!status.isOK())) {
msgassertedNoTrace((status.location() != 0 ? status.location() : status.code()),
status.reason());
diff --git a/src/mongo/util/concurrency/thread_name.h b/src/mongo/util/concurrency/thread_name.h
index c86aef82577..88e7d25bd88 100644
--- a/src/mongo/util/concurrency/thread_name.h
+++ b/src/mongo/util/concurrency/thread_name.h
@@ -30,7 +30,6 @@
#include <string>
#include "mongo/base/string_data.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -43,6 +42,6 @@ namespace mongo {
* Retrieves the name of the current thread, as previously set, or "" if no name was previously
* set.
*/
- MONGO_CLIENT_API const std::string& getThreadName();
+ const std::string& getThreadName();
} // namespace mongo
diff --git a/src/mongo/util/concurrency/threadlocal.h b/src/mongo/util/concurrency/threadlocal.h
index cad8b4966ba..387b3697545 100644
--- a/src/mongo/util/concurrency/threadlocal.h
+++ b/src/mongo/util/concurrency/threadlocal.h
@@ -28,10 +28,7 @@
* then also delete it in the license file.
*/
-#include "mongo/client/undef_macros.h"
#include <boost/thread/tss.hpp>
-#include "mongo/client/redef_macros.h"
-
namespace mongo {
diff --git a/src/mongo/util/logfile.h b/src/mongo/util/logfile.h
index 05be3c68aa3..278b9c162aa 100644
--- a/src/mongo/util/logfile.h
+++ b/src/mongo/util/logfile.h
@@ -32,11 +32,10 @@
#include <string>
-#include "mongo/client/export_macros.h"
namespace mongo {
- class MONGO_CLIENT_API LogFile {
+ class LogFile {
public:
/** create the file and open. must not already exist.
throws UserAssertion on i/o error
diff --git a/src/mongo/util/mmap.h b/src/mongo/util/mmap.h
index ded6279b1ba..7b34b21b254 100644
--- a/src/mongo/util/mmap.h
+++ b/src/mongo/util/mmap.h
@@ -33,7 +33,6 @@
#include <sstream>
#include <vector>
-#include "mongo/client/export_macros.h"
#include "mongo/util/concurrency/rwlock.h"
namespace mongo {
diff --git a/src/mongo/util/net/httpclient.h b/src/mongo/util/net/httpclient.h
index df378ed6180..c2297547fed 100644
--- a/src/mongo/util/net/httpclient.h
+++ b/src/mongo/util/net/httpclient.h
@@ -29,7 +29,6 @@
#pragma once
-#include "mongo/client/export_macros.h"
#include "mongo/platform/basic.h"
#include <boost/noncopyable.hpp>
@@ -38,12 +37,12 @@
namespace mongo {
- class MONGO_CLIENT_API HttpClient : boost::noncopyable {
+ class HttpClient : boost::noncopyable {
public:
typedef std::map<std::string,std::string> Headers;
- class MONGO_CLIENT_API Result {
+ class Result {
public:
Result() {}
diff --git a/src/mongo/util/net/ssl_options.h b/src/mongo/util/net/ssl_options.h
index bc4f2dbbad4..f1b74c1f594 100644
--- a/src/mongo/util/net/ssl_options.h
+++ b/src/mongo/util/net/ssl_options.h
@@ -28,7 +28,6 @@
#pragma once
#include "mongo/base/status.h"
-#include "mongo/client/export_macros.h"
#include "mongo/util/net/ssl_manager.h"
namespace mongo {
@@ -40,7 +39,7 @@ namespace mongo {
namespace moe = mongo::optionenvironment;
- struct MONGO_CLIENT_API SSLGlobalParams {
+ struct SSLGlobalParams {
AtomicInt32 sslMode; // --sslMode - the SSL operation mode, see enum SSLModes
bool sslOnNormalPorts; // --sslOnNormalPorts (deprecated)
std::string sslPEMKeyFile; // --sslPEMKeyFile
@@ -82,7 +81,7 @@ namespace mongo {
};
};
- extern MONGO_CLIENT_API SSLGlobalParams sslGlobalParams;
+ extern SSLGlobalParams sslGlobalParams;
Status addSSLServerOptions(moe::OptionSection* options);
diff --git a/src/mongo/util/time_support.h b/src/mongo/util/time_support.h
index 44fecdb25e1..81db17cbd76 100644
--- a/src/mongo/util/time_support.h
+++ b/src/mongo/util/time_support.h
@@ -37,7 +37,6 @@
#include <boost/version.hpp>
#include "mongo/base/status_with.h"
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -129,9 +128,9 @@ namespace mongo {
// parses time of day in "hh:mm" format assuming 'hh' is 00-23
bool toPointInTime( const std::string& str , boost::posix_time::ptime* timeOfDay );
- MONGO_CLIENT_API void sleepsecs(int s);
- MONGO_CLIENT_API void sleepmillis(long long ms);
- MONGO_CLIENT_API void sleepmicros(long long micros);
+ void sleepsecs(int s);
+ void sleepmillis(long long ms);
+ void sleepmicros(long long micros);
class Backoff {
public:
diff --git a/src/mongo/util/timer.h b/src/mongo/util/timer.h
index 8ee85928f73..2e9c50ac829 100644
--- a/src/mongo/util/timer.h
+++ b/src/mongo/util/timer.h
@@ -29,7 +29,6 @@
#pragma once
-#include "mongo/client/export_macros.h"
namespace mongo {
@@ -44,7 +43,7 @@ namespace mongo {
* 2.5 years will be supported. Since a typical tick duration will be under 10 per nanosecond,
* if not below 1 per nanosecond, this should not be an issue.
*/
- class MONGO_CLIENT_API Timer /*copyable*/ {
+ class Timer /*copyable*/ {
public:
static const long long millisPerSecond = 1000;
static const long long microsPerSecond = 1000 * millisPerSecond;