Skip to content

Commit 57f687a

Browse files
Fix AEGIS build.
1 parent d4c377b commit 57f687a

File tree

6 files changed

+27
-18
lines changed

6 files changed

+27
-18
lines changed

classdesc.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ namespace classdesc
143143

144144
using std::shared_ptr;
145145
using std::weak_ptr;
146-
146+
using std::dynamic_pointer_cast;
147+
147148
using std::is_default_constructible;
148149
using std::is_copy_constructible;
149150
using std::is_assignable;
@@ -229,6 +230,7 @@ namespace classdesc
229230
#if (!defined(__ICC) || __ICC > 1100)
230231
using std::tr1::shared_ptr;
231232
using std::tr1::weak_ptr;
233+
using std::tr1::dynamic_pointer_cast;
232234
#endif
233235

234236
// fake these using TR1 counterparts (which are conservative)
@@ -421,15 +423,15 @@ namespace classdesc
421423
///@}
422424

423425
/// transfer the constness property of T to U
424-
template <class T, class U, bool c=std::is_const<T>::value> struct transfer_const;
426+
template <class T, class U, bool c=is_const<T>::value> struct transfer_const;
425427
template <class T, class U> struct transfer_const<T,U,true>
426428
{
427-
typedef typename std::add_const<U>::type type;
429+
typedef typename add_const<U>::type type;
428430
};
429431

430432
template <class T, class U> struct transfer_const<T,U,false>
431433
{
432-
typedef typename std::remove_const<U>::type type;
434+
typedef typename remove_const<U>::type type;
433435
};
434436

435437
/// utility macro for declaring if a type has a particular member of

examples/graphnode.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ using namespace classdesc;
2828
int foonode::nodecntr=0;
2929

3030
// register in static object to get around leak detector
31-
vector<shared_ptr<foonode>> store;
31+
vector<shared_ptr<foonode> > store;
3232

3333
foonode* newFoonode() {
34-
store.push_back(make_shared<foonode>());
34+
store.push_back(shared_ptr<foonode>(new foonode));
3535
return store.back().get();
3636
}
3737

json_pack_base.h

+11-8
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ namespace classdesc
4444
json_pack_error("json object %s not found", name.c_str()) {}
4545
};
4646

47-
const inline std::map<json5_parser::Value_type,RESTProcessType::Type>& RESTProcessTypeJSONMap()
47+
typedef std::map<json5_parser::Value_type,RESTProcessType::Type> RESTProcessTypeJSONMap_t;
48+
const inline RESTProcessTypeJSONMap_t& RESTProcessTypeJSONMap()
4849
{
49-
static std::map<json5_parser::Value_type,RESTProcessType::Type> jsonMap;
50+
static RESTProcessTypeJSONMap_t jsonMap;
5051
if (jsonMap.empty())
5152
{
5253
jsonMap[json5_parser::obj_type]=RESTProcessType::object;
@@ -63,21 +64,23 @@ namespace classdesc
6364
/// convert a json5_parser::Value_type to a RESTProcessType::Type
6465
inline RESTProcessType::Type Json5ParserTypeToRESTProcessType(json5_parser::Value_type type)
6566
{
66-
auto r=RESTProcessTypeJSONMap().find(type);
67+
RESTProcessTypeJSONMap_t::const_iterator r=RESTProcessTypeJSONMap().find(type);
6768
if (r!=RESTProcessTypeJSONMap().end()) return r->second;
6869
return RESTProcessType::null;
6970
}
70-
71+
7172
/// convert a RESTProcessType::Type to a json5_parser::Value_type
7273
inline json5_parser::Value_type RESTProcessTypeToJson5ParserType(RESTProcessType::Type type)
7374
{
74-
static std::map<RESTProcessType::Type,json5_parser::Value_type> jsonMap;
75+
typedef std::map<RESTProcessType::Type,json5_parser::Value_type> Map;
76+
static Map jsonMap;
7577
if (jsonMap.empty())
7678
{
77-
auto& m=RESTProcessTypeJSONMap();
78-
for (auto& i: m) jsonMap.emplace(i.second,i.first);
79+
const RESTProcessTypeJSONMap_t& m=RESTProcessTypeJSONMap();
80+
for (RESTProcessTypeJSONMap_t::const_iterator i=m.begin(); i!=m.end(); ++i)
81+
jsonMap.insert(std::make_pair(i->second,i->first));
7982
}
80-
auto r=jsonMap.find(type);
83+
Map::const_iterator r=jsonMap.find(type);
8184
if (r!=jsonMap.end()) return r->second;
8285
return json5_parser::null_type;
8386
};

mpi-examples/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ LIBS+=-ldl
6666
endif
6767

6868
ifdef AEGIS
69-
CFLAGS+=-Werror -Wall -Wno-unused-variable
69+
CFLAGS+=-Werror -Wall -Wno-unused-variable -Wno-unused-function
7070
CPLUSPLUS+=-std=c++98
7171
endif
7272

object.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ unpack(classdesc::unpack_t& b, const classdesc::string& d, classdesc::shared_ptr
124124
b>>t;
125125
if (t)
126126
{
127-
std::shared_ptr<classdesc::object> tmp(classdesc::object::create(t-1));
128-
a=std::dynamic_pointer_cast<T>(std::move(tmp));
127+
classdesc::shared_ptr<classdesc::object> tmp(classdesc::object::create(t-1));
128+
#if defined(__cplusplus) && __cplusplus>=201103L
129+
a=classdesc::dynamic_pointer_cast<T>(std::move(tmp));
130+
#else
131+
a=classdesc::dynamic_pointer_cast<T>(tmp);
132+
#endif
129133
a->unpack(b);
130134
}
131135
}

test/testExclude.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int main()
1616
{
1717
pack_t b;
1818
foo f;
19-
shared_ptr<bar> barPtr=make_shared<bar>();
19+
shared_ptr<bar> barPtr(new bar);
2020
f.unpackable=barPtr.get();
2121
f.unpackable->barfoo();
2222
f.foosbar.barfoo();

0 commit comments

Comments
 (0)