Skip to content

Commit 20b6789

Browse files
Linux build fixes, updates for VS 2015.
1 parent 3eed2f2 commit 20b6789

File tree

10 files changed

+131
-72
lines changed

10 files changed

+131
-72
lines changed

aws-cpp-sdk-core/include/aws/core/VersionConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
#define AWS_SDK_VERSION_STRING "0.9-434-g0accc54"
16+
#define AWS_SDK_VERSION_STRING "0.9-444-gfd3bc86"

aws-cpp-sdk-core/include/aws/core/http/URI.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AWS_CORE_API URI
6363
/**
6464
* scheme or protocol e.g. http, https, ftp
6565
*/
66-
inline Scheme GetScheme() const { return scheme;}
66+
inline Scheme GetScheme() const { return m_scheme;}
6767

6868
/**
6969
* Sets scheme, if the port is incompaitible with this scheme, the port will automatically be set as well.
@@ -73,29 +73,29 @@ class AWS_CORE_API URI
7373
/**
7474
* Gets the domain portion of the uri
7575
*/
76-
inline const Aws::String& GetAuthority() const { return authority; }
76+
inline const Aws::String& GetAuthority() const { return m_authority; }
7777

7878
/**
7979
* Sets the domain portion of the uri
8080
*/
81-
inline void SetAuthority(const Aws::String& value) { authority = value; }
81+
inline void SetAuthority(const Aws::String& value) { m_authority = value; }
8282

8383
/**
8484
* Gets the port portion of the uri, defaults to 22 for ftp, 80 for http and 443 for https
8585
*/
86-
inline uint16_t GetPort() const { return port; }
86+
inline uint16_t GetPort() const { return m_port; }
8787

8888
/**
8989
* Sets the port portion of the uri, normally you will not have to do this. If the scheme is set to ftp, http
9090
* or https then the default ports will be set.
9191
*/
92-
inline void SetPort(uint16_t value) { port = value; }
92+
inline void SetPort(uint16_t value) { m_port = value; }
9393

9494
/**
9595
* Gets the path portion of the uri e.g. the portion after the first slash after the authority and prior to the
9696
* query string.
9797
*/
98-
inline const Aws::String& GetPath() const { return path; }
98+
inline const Aws::String& GetPath() const { return m_path; }
9999

100100
/**
101101
* Sets the path portion of the uri. URL encodes it if needed
@@ -110,7 +110,7 @@ class AWS_CORE_API URI
110110
/**
111111
* Gets the raw query string including the ?
112112
*/
113-
inline const Aws::String& GetQueryString() const { return queryString; }
113+
inline const Aws::String& GetQueryString() const { return m_queryString; }
114114

115115
Aws::String GetFormParameters() const;
116116

@@ -144,11 +144,11 @@ class AWS_CORE_API URI
144144
void ExtractAndSetQueryString(const Aws::String& uri);
145145
bool CompareURIParts(const URI& other) const;
146146

147-
Scheme scheme;
148-
Aws::String authority;
149-
uint16_t port;
150-
Aws::String path;
151-
Aws::String queryString;
147+
Scheme m_scheme;
148+
Aws::String m_authority;
149+
uint16_t m_port;
150+
Aws::String m_path;
151+
Aws::String m_queryString;
152152
};
153153

154154
} // namespace Http

aws-cpp-sdk-core/include/aws/core/utils/memory/stl/AWSFunction.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,26 @@ namespace Aws
2626
{
2727

2828
template<typename F>
29-
std::function< F > BuildFunction(const F &f)
29+
std::function< F > BuildFunction(const F& f)
3030
{
31-
return std::function< F >( f, Aws::Allocator<void>() );
31+
return std::function< F >( std::allocator_arg_t(), Aws::Allocator<void>(), f );
3232
}
3333

3434
// some things, like bind results, don't implicity convert to direct function types, catch those with specializations
3535
template<typename F>
36-
std::function< F > BuildFunction(const std::function< F > &f)
36+
std::function< F > BuildFunction(const std::function< F >& f)
3737
{
38-
return std::function< F >( f, Aws::Allocator<void>() );
38+
return std::function< F >( std::allocator_arg_t(), Aws::Allocator<void>(), f );
3939
}
4040

4141
template<typename F>
42-
std::function< F > BuildFunction(std::function< F > &&f)
42+
std::function< F > BuildFunction(std::function< F >&& f)
4343
{
44-
return std::function< F >( std::move(f), Aws::Allocator<void>() );
44+
return std::function< F >( std::allocator_arg_t(), Aws::Allocator<void>(), f );
4545
}
4646

4747
} // namespace Aws
4848

49-
#define AWS_BUILD_FUNCTION(func) Aws::BuildFunction(func)
50-
#define AWS_BUILD_TYPED_FUNCTION(func, type) Aws::BuildFunction<type>(func)
51-
5249
#else // __GNUG__
5350

5451
namespace Aws
@@ -64,20 +61,20 @@ F BuildFunction(F f)
6461

6562
// some things, like bind results, don't implicity convert to direct function types, catch those with specializations
6663
template<typename F>
67-
std::function< F > BuildFunction(const std::function< F > &f)
64+
std::function< F > BuildFunction(const std::function< F >& f)
6865
{
6966
return std::function< F >( f );
7067
}
7168

7269
template<typename F>
73-
std::function< F > BuildFunction(std::function< F > &&f)
70+
std::function< F > BuildFunction(std::function< F >&& f)
7471
{
7572
return std::function< F >( std::move(f));
7673
}
7774

7875
} // namespace Aws
7976

77+
#endif // __GNUG__
78+
8079
#define AWS_BUILD_FUNCTION(func) Aws::BuildFunction(func)
8180
#define AWS_BUILD_TYPED_FUNCTION(func, type) Aws::BuildFunction<type>(func)
82-
83-
#endif // __GNUG__

aws-cpp-sdk-core/source/external/json-cpp/jsoncpp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,8 +2567,8 @@ bool Value::removeIndex(ArrayIndex index, Value* removed) {
25672567
ArrayIndex oldSize = size();
25682568
// shift left all items left, into the place of the "removed"
25692569
for (ArrayIndex i = index; i < (oldSize - 1); ++i){
2570-
CZString key(i);
2571-
(*value_.map_)[key] = (*this)[i + 1];
2570+
CZString iKey(i);
2571+
(*value_.map_)[iKey] = (*this)[i + 1];
25722572
}
25732573
// erase the last one ("leftover")
25742574
CZString keyLast(oldSize - 1);

aws-cpp-sdk-core/source/http/URI.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ const char* SEPARATOR = "://";
3636
} // namespace Http
3737
} // namespace Aws
3838

39-
URI::URI() : scheme(Scheme::HTTP), port(HTTP_DEFAULT_PORT)
39+
URI::URI() : m_scheme(Scheme::HTTP), m_port(HTTP_DEFAULT_PORT)
4040
{
4141
}
4242

43-
URI::URI(const Aws::String& uri) : scheme(Scheme::HTTP), port(HTTP_DEFAULT_PORT)
43+
URI::URI(const Aws::String& uri) : m_scheme(Scheme::HTTP), m_port(HTTP_DEFAULT_PORT)
4444
{
4545
ParseURIParts(uri);
4646
}
4747

48-
URI::URI(const char* uri) : scheme(Scheme::HTTP), port(HTTP_DEFAULT_PORT)
48+
URI::URI(const char* uri) : m_scheme(Scheme::HTTP), m_port(HTTP_DEFAULT_PORT)
4949
{
5050
ParseURIParts(uri);
5151
}
@@ -98,13 +98,13 @@ void URI::SetScheme(Scheme value)
9898

9999
if (value == Scheme::HTTP)
100100
{
101-
port = port == HTTPS_DEFAULT_PORT || port == 0 ? HTTP_DEFAULT_PORT : port;
102-
scheme = value;
101+
m_port = m_port == HTTPS_DEFAULT_PORT || m_port == 0 ? HTTP_DEFAULT_PORT : m_port;
102+
m_scheme = value;
103103
}
104104
else if (value == Scheme::HTTPS)
105105
{
106-
port = port == HTTP_DEFAULT_PORT || port == 0 ? HTTPS_DEFAULT_PORT : port;
107-
scheme = value;
106+
m_port = m_port == HTTP_DEFAULT_PORT || m_port == 0 ? HTTPS_DEFAULT_PORT : m_port;
107+
m_scheme = value;
108108
}
109109
}
110110

@@ -127,17 +127,17 @@ void URI::SetPath(const Aws::String& value, bool shouldEncode)
127127
ss << '/';
128128
}
129129

130-
path = ss.str();
130+
m_path = ss.str();
131131
}
132132
else
133133
{
134-
path = value;
134+
m_path = value;
135135
}
136136
}
137137

138138
Aws::String URI::GetUnEncodedPath() const
139139
{
140-
return StringUtils::URLDecode(path.c_str());
140+
return StringUtils::URLDecode(m_path.c_str());
141141
}
142142

143143
QueryStringParameterCollection URI::GetQueryStringParameters(bool decode) const
@@ -202,7 +202,7 @@ void URI::CanonicalizeQueryString()
202202
queryStringStream << "?";
203203
}
204204

205-
if(queryString.find("=") != std::string::npos)
205+
if(m_queryString.find("=") != std::string::npos)
206206
{
207207
for (QueryStringParameterCollection::iterator iter = sortedParameters.begin();
208208
iter != sortedParameters.end(); ++iter)
@@ -216,47 +216,47 @@ void URI::CanonicalizeQueryString()
216216
queryStringStream << iter->first << "=" << iter->second;
217217
}
218218

219-
queryString = queryStringStream.str();
219+
m_queryString = queryStringStream.str();
220220
}
221221
}
222222

223223
void URI::AddQueryStringParameter(const char* key, const Aws::String& value)
224224
{
225-
if (queryString.size() <= 0)
225+
if (m_queryString.size() <= 0)
226226
{
227-
queryString.append("?");
227+
m_queryString.append("?");
228228
}
229229
else
230230
{
231-
queryString.append("&");
231+
m_queryString.append("&");
232232
}
233233

234-
queryString.append(StringUtils::URLEncode(key) + "=" + StringUtils::URLEncode(value.c_str()));
234+
m_queryString.append(StringUtils::URLEncode(key) + "=" + StringUtils::URLEncode(value.c_str()));
235235
}
236236

237237
Aws::String URI::GetURIString(bool includeQueryString) const
238238
{
239-
assert(authority.size() > 0);
239+
assert(m_authority.size() > 0);
240240

241241
Aws::StringStream ss;
242-
ss << SchemeMapper::ToString(scheme) << SEPARATOR << authority;
242+
ss << SchemeMapper::ToString(m_scheme) << SEPARATOR << m_authority;
243243

244-
if (scheme == Scheme::HTTP && port != HTTP_DEFAULT_PORT)
244+
if (m_scheme == Scheme::HTTP && m_port != HTTP_DEFAULT_PORT)
245245
{
246-
ss << ":" << port;
246+
ss << ":" << m_port;
247247
}
248-
else if (scheme == Scheme::HTTPS && port != HTTPS_DEFAULT_PORT)
248+
else if (m_scheme == Scheme::HTTPS && m_port != HTTPS_DEFAULT_PORT)
249249
{
250-
ss << ":" << port;
250+
ss << ":" << m_port;
251251
}
252252

253-
if(path != "/")
253+
if(m_path != "/")
254254
{
255-
ss << path;
255+
ss << m_path;
256256
}
257257

258258
if(includeQueryString)
259-
ss << queryString;
259+
ss << m_queryString;
260260

261261
return ss.str();
262262
}
@@ -389,23 +389,23 @@ void URI::ExtractAndSetQueryString(const Aws::String& uri)
389389

390390
if (queryStart != Aws::String::npos)
391391
{
392-
queryString = uri.substr(queryStart);
392+
m_queryString = uri.substr(queryStart);
393393
}
394394
}
395395

396396
Aws::String URI::GetFormParameters() const
397397
{
398-
if(queryString.length() == 0)
398+
if(m_queryString.length() == 0)
399399
{
400400
return "";
401401
}
402402
else
403403
{
404-
return queryString.substr(1);
404+
return m_queryString.substr(1);
405405
}
406406
}
407407

408408
bool URI::CompareURIParts(const URI& other) const
409409
{
410-
return scheme == other.scheme && authority == other.authority && path == other.path && queryString == other.queryString;
410+
return m_scheme == other.m_scheme && m_authority == other.m_authority && m_path == other.m_path && m_queryString == other.m_queryString;
411411
}

aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,26 @@ TEST_F(TableOperationTest, TestListTable)
291291
DeleteAllTables();
292292
CreateTable(SIMPLE_TABLE, 10, 10);
293293

294+
Aws::Vector<Aws::String> filteredTableNames;
295+
294296
ListTablesRequest listTablesRequest;
295297
listTablesRequest.SetLimit(10);
296-
ListTablesOutcome listTablesOutcome = m_client->ListTables(listTablesRequest);
297-
EXPECT_TRUE(listTablesOutcome.IsSuccess());
298298

299-
Aws::Vector<Aws::String> filteredTableNames;
300-
auto tableNames = listTablesOutcome.GetResult().GetTableNames();
301-
std::copy_if(tableNames.cbegin(),
302-
tableNames.cend(),
303-
std::back_inserter(filteredTableNames),
304-
[](const Aws::String& tableName) { return tableName.find(TEST_TABLE_PREFIX) == 0; });
299+
bool done = false;
300+
while(!done)
301+
{
302+
ListTablesOutcome listTablesOutcome = m_client->ListTables(listTablesRequest);
303+
EXPECT_TRUE(listTablesOutcome.IsSuccess());
304+
305+
auto tableNames = listTablesOutcome.GetResult().GetTableNames();
306+
std::copy_if(tableNames.cbegin(),
307+
tableNames.cend(),
308+
std::back_inserter(filteredTableNames),
309+
[](const Aws::String& tableName) { return tableName.find(TEST_TABLE_PREFIX) == 0; });
310+
311+
listTablesRequest.SetExclusiveStartTableName(listTablesOutcome.GetResult().GetLastEvaluatedTableName());
312+
done = listTablesRequest.GetExclusiveStartTableName().empty();
313+
}
305314

306315
EXPECT_EQ(1uL, filteredTableNames.size());
307316
if(filteredTableNames.size() > 0)

aws-cpp-sdk-identity-management-tests/auth/PersistentCognitoIdentityProvider_JsonFileImplTest.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,22 @@ Aws::String ComputeIdentityFilePath()
4444
static bool s_initialized = false;
4545
static char s_tempName[L_tmpnam+1];
4646

47+
/*
48+
Prior to VS 2014, tmpnam/tmpnam_s generated root level files ("\filename") which were not appropriate for our usage, so for the windows version, we prepended a '.' to make it a
49+
tempfile in the current directory. Starting with VS2014, the behavior of tmpnam/tmpnam_s was changed to be a full, valid filepath based on the
50+
current user ("C:\Users\username\AppData\Local\Temp\...").
51+
52+
See the tmpnam section in http://blogs.msdn.com/b/vcblog/archive/2014/06/18/crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1.aspx
53+
for more details.
54+
*/
4755
if(!s_initialized)
4856
{
57+
#if _MSC_VER >= 1900
58+
tmpnam_s(s_tempName, L_tmpnam);
59+
#else
4960
s_tempName[0] = '.';
5061
tmpnam_s(s_tempName + 1, L_tmpnam);
62+
#endif // _MSC_VER
5163
s_initialized = true;
5264
}
5365

0 commit comments

Comments
 (0)