Junxiao Shi | 8d71fdb | 2014-12-07 21:55:19 -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 | |
Davide Pesavento | 96b96af | 2015-09-19 23:00:40 +0200 | [diff] [blame] | 5 | STD_TO_STRING = ''' |
| 6 | #include <string> |
| 7 | int |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 8 | main() |
Davide Pesavento | 96b96af | 2015-09-19 23:00:40 +0200 | [diff] [blame] | 9 | { |
| 10 | std::string s = std::to_string(0); |
| 11 | s = std::to_string(0l); |
| 12 | s = std::to_string(0ll); |
| 13 | s = std::to_string(0u); |
| 14 | s = std::to_string(0ul); |
| 15 | s = std::to_string(0ull); |
| 16 | s = std::to_string(0.0f); |
| 17 | s = std::to_string(0.0); |
| 18 | s = std::to_string(0.0l); |
| 19 | s.clear(); |
Davide Pesavento | 96b96af | 2015-09-19 23:00:40 +0200 | [diff] [blame] | 20 | } |
| 21 | ''' |
| 22 | |
| 23 | @conf |
| 24 | def check_std_to_string(self): |
| 25 | if self.check_cxx(msg='Checking for std::to_string', |
Davide Pesavento | 844b093 | 2018-05-07 01:00:16 -0400 | [diff] [blame^] | 26 | fragment=STD_TO_STRING, mandatory=False): |
Davide Pesavento | 96b96af | 2015-09-19 23:00:40 +0200 | [diff] [blame] | 27 | self.define('HAVE_STD_TO_STRING', 1) |
| 28 | |
Junxiao Shi | 8d71fdb | 2014-12-07 21:55:19 -0700 | [diff] [blame] | 29 | def configure(conf): |
Davide Pesavento | 96b96af | 2015-09-19 23:00:40 +0200 | [diff] [blame] | 30 | conf.check_std_to_string() |