Skip to content

Commit ff6e373

Browse files
Merge pull request #22 from awslabs/FB-LibCppFix
Fb lib cpp fix
2 parents 0268967 + b37126e commit ff6e373

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/json/JsonServiceOperationsSource.vm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ ${operation.name}Outcome ${className}::${operation.name}(const ${operation.reque
4646

4747
${operation.name}OutcomeCallable ${className}::${operation.name}Callable(const ${operation.request.shape.name}& request) const
4848
{
49-
return std::async(std::launch::async, &${className}::${operation.name}, this, request);
49+
return std::async(std::launch::async, [this, request](){ return this->${operation.name}(request); } );
5050
}
5151

5252
void ${className}::${operation.name}Async(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
5353
{
54-
m_executor->Submit(&${className}::${operation.name}AsyncHelper, this, request, handler, context);
54+
m_executor->Submit( [this, request, handler, context](){ this->${operation.name}AsyncHelper( request, handler, context ); } );
5555
}
5656

5757
void ${className}::${operation.name}AsyncHelper(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
@@ -90,12 +90,12 @@ ${operation.name}Outcome ${className}::${operation.name}() const
9090

9191
${operation.name}OutcomeCallable ${className}::${operation.name}Callable() const
9292
{
93-
return std::async(std::launch::async, &${className}::${operation.name}, this);
93+
return std::async(std::launch::async, [this](){ return this->${operation.name}(); } );
9494
}
9595

9696
void ${className}::${operation.name}Async(const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
9797
{
98-
m_executor->Submit(&${className}::${operation.name}AsyncHelper, this, handler, context);
98+
m_executor->Submit( [this, handler, context](){ this->${operation.name}AsyncHelper( handler, context ); } );
9999
}
100100

101101
void ${className}::${operation.name}AsyncHelper(const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const

code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/machinelearning/MachineLearningServiceClientSource.vm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ ${operation.name}Outcome ${className}::${operation.name}(const ${operation.reque
6767

6868
${operation.name}OutcomeCallable ${className}::${operation.name}Callable(const ${operation.request.shape.name}& request) const
6969
{
70-
return std::async(std::launch::async, &${className}::${operation.name}, this, request);
70+
return std::async(std::launch::async, [this, request](){ return this->${operation.name}( request ); } );
7171
}
7272

7373
void ${className}::${operation.name}Async(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
7474
{
75-
m_executor->Submit(&${className}::${operation.name}AsyncHelper, this, request, handler, context);
75+
m_executor->Submit( [this, request, handler, context](){ this->${operation.name}AsyncHelper(request, handler, context); } );
7676
}
7777

7878
void ${className}::${operation.name}AsyncHelper(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const

code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/sqs/SQSServiceClientSource.vm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ ${operation.name}Outcome ${className}::${operation.name}(const ${operation.reque
6868

6969
${operation.name}OutcomeCallable ${className}::${operation.name}Callable(const ${operation.request.shape.name}& request) const
7070
{
71-
return std::async(std::launch::async, &${className}::${operation.name}, this, request);
71+
return std::async(std::launch::async, [this, request](){ return this->${operation.name}(request); });
7272
}
7373

7474
void ${className}::${operation.name}Async(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
7575
{
76-
m_executor->Submit(&${className}::${operation.name}AsyncHelper, this, request, handler, context);
76+
m_executor->Submit( [this, request, handler, context](){ this->${operation.name}AsyncHelper(request, handler, context); } );
7777
}
7878

7979
void ${className}::${operation.name}AsyncHelper(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const

code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/xml/rest/RestXmlServiceClientOperations.vm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ ${operation.name}Outcome ${className}::${operation.name}(const ${operation.reque
4545

4646
${operation.name}OutcomeCallable ${className}::${operation.name}Callable(const ${operation.request.shape.name}& request) const
4747
{
48-
return std::async(std::launch::async, &${className}::${operation.name}, this, request);
48+
return std::async(std::launch::async, [this, request](){ return this->${operation.name}( request ); } );
4949
}
5050

5151
void ${className}::${operation.name}Async(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
5252
{
53-
m_executor->Submit(&${className}::${operation.name}AsyncHelper, this, request, handler, context);
53+
m_executor->Submit( [this, request, handler, context](){ this->${operation.name}AsyncHelper( request, handler, context ); } );
5454
}
5555

5656
void ${className}::${operation.name}AsyncHelper(const ${operation.request.shape.name}& request, const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
@@ -88,12 +88,12 @@ ${operation.name}Outcome ${className}::${operation.name}() const
8888

8989
${operation.name}OutcomeCallable ${className}::${operation.name}Callable() const
9090
{
91-
return std::async(std::launch::async, &${className}::${operation.name}, this);
91+
return std::async(std::launch::async, [this](){ return this->${operation.name}(); } );
9292
}
9393

9494
void ${className}::${operation.name}Async(const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
9595
{
96-
m_executor->Submit(&${className}::${operation.name}AsyncHelper, this, handler, context);
96+
m_executor->Submit( [this, handler, context](){ this->${operation.name}AsyncHelper( handler, context ); } );
9797
}
9898

9999
void ${className}::${operation.name}AsyncHelper(const ${operation.name}ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const

scripts/build_3rdparty.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ def Main():
271271
print( "No definition for target architecture " + architecture )
272272
return 1
273273

274+
if architecture == "Linux":
275+
os.environ["CXX"] = "clang++ -stdlib=libc++"
276+
274277
targetPlatformDef = platformBuildTargets[ architecture ]
275278
if not sourcePlatform in targetPlatformDef[ 'buildPlatforms' ]:
276279
print( "Platform " + sourcePlatform + " does not support building for architecture " + architecture )

0 commit comments

Comments
 (0)