blob: 1602f16838e4d86537a1c6f86d817ac48a1eefd7 [file] [log] [blame]
Junxiao Shi8d71fdb2014-12-07 21:55:19 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3from waflib.Configure import conf
4
Davide Pesavento96b96af2015-09-19 23:00:40 +02005STD_TO_STRING = '''
6#include <string>
7int
Davide Pesavento7c02b472015-10-28 20:50:17 +01008main()
Davide Pesavento96b96af2015-09-19 23:00:40 +02009{
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 Pesavento96b96af2015-09-19 23:00:40 +020020}
21'''
22
23@conf
24def check_std_to_string(self):
25 if self.check_cxx(msg='Checking for std::to_string',
Davide Pesavento844b0932018-05-07 01:00:16 -040026 fragment=STD_TO_STRING, mandatory=False):
Davide Pesavento96b96af2015-09-19 23:00:40 +020027 self.define('HAVE_STD_TO_STRING', 1)
28
Junxiao Shi8d71fdb2014-12-07 21:55:19 -070029def configure(conf):
Davide Pesavento96b96af2015-09-19 23:00:40 +020030 conf.check_std_to_string()