~ubuntu-branches/ubuntu/trusty/mongodb/trusty-proposed

« back to all changes in this revision

Viewing changes to stdafx.h

  • Committer: Bazaar Package Importer
  • Author(s): Antonin Kral
  • Date: 2010-01-29 19:48:45 UTC
  • Revision ID: james.westby@ubuntu.com-20100129194845-8wbmkf626fwcavc9
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// stdafx.h : include file for standard system include files,
 
2
// or project specific include files that are used frequently, but
 
3
// are changed infrequently
 
4
//
 
5
 
 
6
/*    Copyright 2009 10gen Inc.
 
7
 *
 
8
 *    Licensed under the Apache License, Version 2.0 (the "License");
 
9
 *    you may not use this file except in compliance with the License.
 
10
 *    You may obtain a copy of the License at
 
11
 *
 
12
 *    http://www.apache.org/licenses/LICENSE-2.0
 
13
 *
 
14
 *    Unless required by applicable law or agreed to in writing, software
 
15
 *    distributed under the License is distributed on an "AS IS" BASIS,
 
16
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
 *    See the License for the specific language governing permissions and
 
18
 *    limitations under the License.
 
19
 */
 
20
 
 
21
#pragma once
 
22
 
 
23
#include <string>
 
24
 
 
25
namespace mongo {
 
26
 
 
27
    using namespace std;
 
28
 
 
29
#define NOMINMAX
 
30
 
 
31
#if defined(_WIN32)
 
32
    const bool debug=true;
 
33
#else
 
34
    const bool debug=false;
 
35
#endif
 
36
 
 
37
    // pdfile versions
 
38
    const int VERSION = 4;
 
39
    const int VERSION_MINOR = 5;
 
40
    
 
41
    // mongo version
 
42
    extern const char versionString[];
 
43
    
 
44
    enum ExitCode {
 
45
        EXIT_CLEAN = 0 , 
 
46
        EXIT_BADOPTIONS = 2 , 
 
47
        EXIT_REPLICATION_ERROR = 3 ,
 
48
        EXIT_NEED_UPGRADE = 4 ,
 
49
        EXIT_KILL = 12 ,
 
50
        EXIT_ABRUBT = 14 ,
 
51
        EXIT_NTSERVICE_ERROR = 20 ,
 
52
        EXIT_JAVA = 21 ,
 
53
        EXIT_OOM_MALLOC = 42 , 
 
54
        EXIT_OOM_REALLOC = 43 , 
 
55
        EXIT_FS = 45 ,
 
56
        EXIT_POSSIBLE_CORRUPTION = 60 , // this means we detected a possible corruption situation, like a buf overflow
 
57
        EXIT_UNCAUGHT = 100 , // top level exception that wasn't caught
 
58
        EXIT_TEST = 101 ,
 
59
 
 
60
    };
 
61
 
 
62
    void dbexit( ExitCode returnCode, const char *whyMsg = "");
 
63
 
 
64
    /**
 
65
       this is here so you can't just type exit() to quit the program
 
66
       you should either use dbexit to shutdown cleanly, or ::exit to tell the system to quiy
 
67
       if you use this, you'll get a link error since mongo::exit isn't defined
 
68
     */
 
69
    void exit( ExitCode returnCode );
 
70
    bool inShutdown();
 
71
    
 
72
} // namespace mongo
 
73
 
 
74
#include <memory>
 
75
#include <string>
 
76
#include <iostream>
 
77
#include <fstream>
 
78
#include <map>
 
79
#include <vector>
 
80
#include <set>
 
81
#include <stdio.h>
 
82
#include <stdlib.h>
 
83
#include <sstream>
 
84
#include <signal.h>
 
85
 
 
86
#include "targetver.h"
 
87
#include "time.h"
 
88
#include "string.h"
 
89
#include "limits.h"
 
90
 
 
91
///using namespace std;
 
92
 
 
93
#undef yassert
 
94
#include <boost/archive/iterators/base64_from_binary.hpp>
 
95
#include <boost/archive/iterators/binary_from_base64.hpp>
 
96
#include <boost/archive/iterators/transform_width.hpp>
 
97
#include <boost/filesystem/convenience.hpp>
 
98
#include <boost/filesystem/operations.hpp>
 
99
#include <boost/program_options.hpp>
 
100
#include <boost/shared_ptr.hpp>
 
101
#include <boost/smart_ptr.hpp>
 
102
#define BOOST_SPIRIT_THREADSAFE
 
103
 
 
104
#include <boost/version.hpp>
 
105
 
 
106
#if BOOST_VERSION >= 103800
 
107
#define BOOST_SPIRIT_USE_OLD_NAMESPACE
 
108
#include <boost/spirit/include/classic_core.hpp>
 
109
#include <boost/spirit/include/classic_loops.hpp>
 
110
#include <boost/spirit/include/classic_lists.hpp>
 
111
#else
 
112
#include <boost/spirit/core.hpp>
 
113
#include <boost/spirit/utility/loops.hpp>
 
114
#include <boost/spirit/utility/lists.hpp>
 
115
#endif
 
116
 
 
117
#include <boost/tuple/tuple.hpp>
 
118
#include <boost/thread/thread.hpp>
 
119
#include <boost/thread/condition.hpp>
 
120
#include <boost/thread/recursive_mutex.hpp>
 
121
#include <boost/thread/xtime.hpp>
 
122
#undef assert
 
123
#define assert xassert
 
124
#define yassert 1
 
125
 
 
126
namespace mongo {
 
127
    using namespace boost::filesystem;
 
128
}
 
129
 
 
130
#include "util/debug_util.h"
 
131
#include "util/goodies.h"
 
132
#include "util/log.h"
 
133
#include "util/allocator.h"
 
134
#include "util/assert_util.h"
 
135
 
 
136
namespace mongo {
 
137
 
 
138
    void sayDbContext(const char *msg = 0);
 
139
    void rawOut( const string &s );
 
140
 
 
141
} // namespace mongo
 
142
 
 
143
namespace mongo {
 
144
 
 
145
    const char * gitVersion();
 
146
    const char * sysInfo();
 
147
    string mongodVersion();
 
148
    
 
149
    void printGitVersion();
 
150
    void printSysInfo();
 
151
 
 
152
    typedef char _TCHAR;
 
153
 
 
154
#define null (0)
 
155
 
 
156
} // namespace mongo