Junxiao Shi | 1c93cae | 2014-12-09 22:52:17 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | from waflib.Configure import conf |
| 4 | |
| 5 | OVERRIDE = ''' |
| 6 | class Base |
| 7 | { |
| 8 | virtual void |
| 9 | f(int a); |
| 10 | }; |
| 11 | |
| 12 | class Derived : public Base |
| 13 | { |
| 14 | virtual void |
| 15 | f(int a) override; |
| 16 | }; |
| 17 | ''' |
| 18 | |
| 19 | @conf |
| 20 | def check_override(self): |
Alexander Afanasyev | ce81230 | 2015-04-14 14:06:29 -0700 | [diff] [blame^] | 21 | self.check_cxx(msg='Checking for override specifier', |
| 22 | fragment=OVERRIDE, |
| 23 | define_name='HAVE_CXX_OVERRIDE', |
| 24 | features='cxx', mandatory=False) |
| 25 | |
| 26 | STD_TO_STRING = ''' |
| 27 | #include <string> |
| 28 | int |
| 29 | main(int argc, char** argv) |
| 30 | { |
| 31 | std::string s = std::to_string(0); |
| 32 | s = std::to_string(0l); |
| 33 | s = std::to_string(0ll); |
| 34 | s = std::to_string(0u); |
| 35 | s = std::to_string(0ul); |
| 36 | s = std::to_string(0ull); |
| 37 | s = std::to_string(0.0f); |
| 38 | s = std::to_string(0.0); |
| 39 | s = std::to_string(0.0l); |
| 40 | s.clear(); |
| 41 | return 0; |
| 42 | } |
| 43 | ''' |
| 44 | |
| 45 | @conf |
| 46 | def check_std_to_string(self): |
| 47 | self.check_cxx(msg='Checking for std::to_string', |
| 48 | fragment=STD_TO_STRING, |
| 49 | define_name='HAVE_STD_TO_STRING', |
| 50 | features='cxx', mandatory=False) |
Junxiao Shi | 1c93cae | 2014-12-09 22:52:17 -0700 | [diff] [blame] | 51 | |
| 52 | def configure(conf): |
| 53 | conf.check_override() |
Alexander Afanasyev | ce81230 | 2015-04-14 14:06:29 -0700 | [diff] [blame^] | 54 | conf.check_std_to_string() |