symbols.hpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. // Copyright (c) 2001-2011 Hartmut Kaiser
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #if !defined(BOOST_SPIRIT_KARMA_SYMBOLS_NOV_23_2009_1251PM)
  6. #define BOOST_SPIRIT_KARMA_SYMBOLS_NOV_23_2009_1251PM
  7. #include <boost/spirit/home/support/common_terminals.hpp>
  8. #include <boost/spirit/home/support/info.hpp>
  9. #include <boost/spirit/home/support/unused.hpp>
  10. #include <boost/spirit/home/support/attributes_fwd.hpp>
  11. #include <boost/spirit/home/support/detail/get_encoding.hpp>
  12. #include <boost/spirit/home/karma/detail/attributes.hpp>
  13. #include <boost/spirit/home/karma/detail/extract_from.hpp>
  14. #include <boost/spirit/home/karma/domain.hpp>
  15. #include <boost/spirit/home/karma/meta_compiler.hpp>
  16. #include <boost/spirit/home/karma/reference.hpp>
  17. #include <boost/spirit/home/karma/generate.hpp>
  18. #include <boost/spirit/home/karma/delimit_out.hpp>
  19. #include <boost/spirit/home/karma/detail/get_casetag.hpp>
  20. #include <boost/spirit/home/karma/detail/string_generate.hpp>
  21. #include <boost/config.hpp>
  22. #include <boost/shared_ptr.hpp>
  23. #include <boost/mpl/if.hpp>
  24. #include <map>
  25. #include <set>
  26. #if defined(BOOST_MSVC)
  27. # pragma warning(push)
  28. # pragma warning(disable: 4355) // 'this' : used in base member initializer list warning
  29. #endif
  30. ///////////////////////////////////////////////////////////////////////////////
  31. namespace boost { namespace spirit { namespace traits
  32. {
  33. template <typename T, typename Attribute, typename Enable>
  34. struct symbols_lookup
  35. {
  36. typedef
  37. mpl::eval_if<fusion::traits::is_sequence<T>
  38. , traits::detail::value_at_c<T, 0>
  39. , detail::add_const_ref<T> > sequence_type;
  40. typedef typename
  41. mpl::eval_if<traits::is_container<T>
  42. , traits::container_value<T>
  43. , sequence_type>::type type;
  44. // fusion sequence
  45. template <typename T_>
  46. static type call(T_ const& t, mpl::false_, mpl::true_)
  47. {
  48. return fusion::at_c<0>(t);
  49. }
  50. // container
  51. template <typename T_, typename IsSequence>
  52. static type call(T_ const& t, mpl::true_, IsSequence)
  53. {
  54. return t[0];
  55. }
  56. // not a container and not a fusion sequence
  57. template <typename T_>
  58. static type call(T_ const& t, mpl::false_, mpl::false_)
  59. {
  60. return t;
  61. }
  62. static type call(T const& t)
  63. {
  64. typedef typename traits::is_container<T>::type is_container;
  65. typedef typename fusion::traits::is_sequence<T>::type is_sequence;
  66. return call(t, is_container(), is_sequence());
  67. }
  68. };
  69. template <typename Attribute>
  70. struct symbols_lookup<Attribute, Attribute>
  71. {
  72. typedef Attribute const& type;
  73. static type call(Attribute const& t)
  74. {
  75. return t;
  76. }
  77. };
  78. template <typename Attribute, typename T, typename Enable>
  79. struct symbols_value
  80. {
  81. typedef
  82. mpl::eval_if<fusion::traits::is_sequence<T>
  83. , traits::detail::value_at_c<T, 1>
  84. , mpl::identity<unused_type> > sequence_type;
  85. typedef typename
  86. mpl::eval_if<traits::is_container<T>
  87. , traits::container_value<T>
  88. , sequence_type>::type type;
  89. // fusion sequence
  90. template <typename T_>
  91. static type call(T_ const& t, mpl::false_, mpl::true_)
  92. {
  93. return fusion::at_c<1>(t);
  94. }
  95. // container
  96. template <typename T_, typename IsSequence>
  97. static type call(T_ const& t, mpl::true_, IsSequence)
  98. {
  99. return t[1];
  100. }
  101. // not a container nor a fusion sequence
  102. template <typename T_>
  103. static type call(T_ const&, mpl::false_, mpl::false_)
  104. {
  105. return unused;
  106. }
  107. static type call(T const& t)
  108. {
  109. typedef typename traits::is_container<T>::type is_container;
  110. typedef typename fusion::traits::is_sequence<T>::type is_sequence;
  111. return call(t, is_container(), is_sequence());
  112. }
  113. };
  114. template <typename Attribute>
  115. struct symbols_value<Attribute, Attribute>
  116. {
  117. typedef unused_type type;
  118. static type call(Attribute const&)
  119. {
  120. return unused;
  121. }
  122. };
  123. }}}
  124. ///////////////////////////////////////////////////////////////////////////////
  125. namespace boost { namespace spirit { namespace karma
  126. {
  127. ///////////////////////////////////////////////////////////////////////////
  128. template <typename T, typename Attribute>
  129. struct symbols_lookup
  130. : mpl::if_<
  131. traits::not_is_unused<T>
  132. , std::map<Attribute, T>
  133. , std::set<Attribute>
  134. >
  135. {};
  136. ///////////////////////////////////////////////////////////////////////////
  137. namespace detail
  138. {
  139. ///////////////////////////////////////////////////////////////////////
  140. template <typename CharEncoding, typename Tag>
  141. struct generate_encoded
  142. {
  143. typedef typename
  144. proto::terminal<tag::char_code<Tag, CharEncoding> >::type
  145. encoding_type;
  146. template <typename OutputIterator, typename Expr, typename Attribute>
  147. static bool call(OutputIterator& sink, Expr const& expr
  148. , Attribute const& attr)
  149. {
  150. encoding_type const encoding = encoding_type();
  151. return karma::generate(sink, encoding[expr], attr);
  152. }
  153. };
  154. template <>
  155. struct generate_encoded<unused_type, unused_type>
  156. {
  157. template <typename OutputIterator, typename Expr, typename Attribute>
  158. static bool call(OutputIterator& sink, Expr const& expr
  159. , Attribute const& attr)
  160. {
  161. return karma::generate(sink, expr, attr);
  162. }
  163. };
  164. }
  165. template <
  166. typename Attribute = char, typename T = unused_type
  167. , typename Lookup = typename symbols_lookup<T, Attribute>::type
  168. , typename CharEncoding = unused_type, typename Tag = unused_type>
  169. struct symbols
  170. : proto::extends<
  171. typename proto::terminal<
  172. reference<symbols<Attribute, T, Lookup, CharEncoding, Tag> >
  173. >::type
  174. , symbols<Attribute, T, Lookup, CharEncoding, Tag> >
  175. , primitive_generator<
  176. symbols<Attribute, T, Lookup, CharEncoding, Tag> >
  177. {
  178. typedef T value_type; // the value associated with each entry
  179. typedef reference<symbols> reference_;
  180. typedef typename proto::terminal<reference_>::type terminal;
  181. typedef proto::extends<terminal, symbols> base_type;
  182. template <typename Context, typename Unused>
  183. struct attribute
  184. {
  185. typedef Attribute type;
  186. };
  187. symbols(std::string const& name = "symbols")
  188. : base_type(terminal::make(reference_(*this)))
  189. , add(*this)
  190. , remove(*this)
  191. , lookup(new Lookup())
  192. , name_(name)
  193. {}
  194. symbols(symbols const& syms)
  195. : base_type(terminal::make(reference_(*this)))
  196. , add(*this)
  197. , remove(*this)
  198. , lookup(syms.lookup)
  199. , name_(syms.name_)
  200. {}
  201. template <typename CharEncoding_, typename Tag_>
  202. symbols(symbols<Attribute, T, Lookup, CharEncoding_, Tag_> const& syms)
  203. : base_type(terminal::make(reference_(*this)))
  204. , add(*this)
  205. , remove(*this)
  206. , lookup(syms.lookup)
  207. , name_(syms.name_)
  208. {}
  209. template <typename Symbols, typename Data>
  210. symbols(Symbols const& syms, Data const& data
  211. , std::string const& name = "symbols")
  212. : base_type(terminal::make(reference_(*this)))
  213. , add(*this)
  214. , remove(*this)
  215. , lookup(new Lookup())
  216. , name_(name)
  217. {
  218. typename range_const_iterator<Symbols>::type si = boost::begin(syms);
  219. typename range_const_iterator<Data>::type di = boost::begin(data);
  220. while (si != boost::end(syms))
  221. add(*si++, *di++);
  222. }
  223. symbols&
  224. operator=(symbols const& rhs)
  225. {
  226. *lookup = *rhs.lookup;
  227. name_ = rhs.name_;
  228. return *this;
  229. }
  230. template <typename CharEncoding_, typename Tag_>
  231. symbols&
  232. operator=(symbols<Attribute, T, Lookup, CharEncoding_, Tag_> const& rhs)
  233. {
  234. *lookup = *rhs.lookup;
  235. name_ = rhs.name_;
  236. return *this;
  237. }
  238. void clear()
  239. {
  240. lookup->clear();
  241. }
  242. struct adder;
  243. struct remover;
  244. template <typename Attr, typename T_>
  245. adder const&
  246. operator=(std::pair<Attr, T_> const& p)
  247. {
  248. lookup->clear();
  249. return add(p.first, p.second);
  250. }
  251. template <typename Attr, typename T_>
  252. friend adder const&
  253. operator+= (symbols& sym, std::pair<Attr, T_> const& p)
  254. {
  255. return sym.add(p.first, p.second);
  256. }
  257. template <typename Attr>
  258. friend remover const&
  259. operator-= (symbols& sym, Attr const& attr)
  260. {
  261. return sym.remove(attr);
  262. }
  263. #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
  264. // non-const version needed to suppress proto's += kicking in
  265. template <typename Attr, typename T_>
  266. friend adder const&
  267. operator+= (symbols& sym, std::pair<Attr, T_>& p)
  268. {
  269. return sym.add(p.first, p.second);
  270. }
  271. // non-const version needed to suppress proto's -= kicking in
  272. template <typename Attr>
  273. friend remover const&
  274. operator-= (symbols& sym, Attr& attr)
  275. {
  276. return sym.remove(attr);
  277. }
  278. #else
  279. // for rvalue references
  280. template <typename Attr, typename T_>
  281. friend adder const&
  282. operator+= (symbols& sym, std::pair<Attr, T_>&& p)
  283. {
  284. return sym.add(p.first, p.second);
  285. }
  286. // for rvalue references
  287. template <typename Attr>
  288. friend remover const&
  289. operator-= (symbols& sym, Attr&& attr)
  290. {
  291. return sym.remove(attr);
  292. }
  293. #endif
  294. template <typename F>
  295. void for_each(F f) const
  296. {
  297. std::for_each(lookup->begin(), lookup->end(), f);
  298. }
  299. template <typename Attr>
  300. value_type* find(Attr const& attr)
  301. {
  302. typename Lookup::iterator it = lookup->find(attr);
  303. return (it != lookup->end()) ? &(*it).second : 0;
  304. }
  305. template <typename Attr>
  306. value_type& at(Attr const& attr)
  307. {
  308. return (*lookup)[attr];
  309. }
  310. ///////////////////////////////////////////////////////////////////////
  311. template <typename OutputIterator, typename Context, typename Delimiter
  312. , typename Attr>
  313. bool generate(OutputIterator& sink, Context&, Delimiter const& d
  314. , Attr const& attr) const
  315. {
  316. typename Lookup::iterator it = lookup->find(
  317. traits::symbols_lookup<Attr, Attribute>::call(attr));
  318. if (it == lookup->end())
  319. return false;
  320. return karma::detail::generate_encoded<CharEncoding, Tag>::call(
  321. sink, (*it).second
  322. , traits::symbols_value<Attribute, Attr>::call(attr)) &&
  323. karma::delimit_out(sink, d);
  324. }
  325. template <typename Context>
  326. info what(Context&) const
  327. {
  328. return info(name_);
  329. }
  330. void name(std::string const &str)
  331. {
  332. name_ = str;
  333. }
  334. std::string const &name() const
  335. {
  336. return name_;
  337. }
  338. ///////////////////////////////////////////////////////////////////////
  339. struct adder
  340. {
  341. template <typename, typename = unused_type>
  342. struct result { typedef adder const& type; };
  343. adder(symbols& sym)
  344. : sym(sym)
  345. {
  346. }
  347. template <typename Attr>
  348. adder const&
  349. operator()(Attr const& attr, T const& val = T()) const
  350. {
  351. sym.lookup->insert(typename Lookup::value_type(attr, val));
  352. return *this;
  353. }
  354. template <typename Attr>
  355. adder const&
  356. operator, (Attr const& attr) const
  357. {
  358. sym.lookup->insert(typename Lookup::value_type(attr, T()));
  359. return *this;
  360. }
  361. symbols& sym;
  362. // silence MSVC warning C4512: assignment operator could not be generated
  363. BOOST_DELETED_FUNCTION(adder& operator= (adder const&))
  364. };
  365. struct remover
  366. {
  367. template <typename>
  368. struct result { typedef remover const& type; };
  369. remover(symbols& sym)
  370. : sym(sym)
  371. {
  372. }
  373. template <typename Attr>
  374. remover const&
  375. operator()(Attr const& attr) const
  376. {
  377. sym.lookup->erase(attr);
  378. return *this;
  379. }
  380. template <typename Attr>
  381. remover const&
  382. operator, (Attr const& attr) const
  383. {
  384. sym.lookup->erase(attr);
  385. return *this;
  386. }
  387. symbols& sym;
  388. // silence MSVC warning C4512: assignment operator could not be generated
  389. BOOST_DELETED_FUNCTION(remover& operator= (remover const&))
  390. };
  391. adder add;
  392. remover remove;
  393. shared_ptr<Lookup> lookup;
  394. std::string name_;
  395. };
  396. ///////////////////////////////////////////////////////////////////////////
  397. // specialization for unused stored type
  398. template <
  399. typename Attribute, typename Lookup
  400. , typename CharEncoding, typename Tag>
  401. struct symbols<Attribute, unused_type, Lookup, CharEncoding, Tag>
  402. : proto::extends<
  403. typename proto::terminal<
  404. spirit::karma::reference<
  405. symbols<Attribute, unused_type, Lookup, CharEncoding, Tag> >
  406. >::type
  407. , symbols<Attribute, unused_type, Lookup, CharEncoding, Tag>
  408. >
  409. , spirit::karma::generator<
  410. symbols<Attribute, unused_type, Lookup, CharEncoding, Tag> >
  411. {
  412. typedef unused_type value_type; // the value associated with each entry
  413. typedef spirit::karma::reference<symbols> reference_;
  414. typedef typename proto::terminal<reference_>::type terminal;
  415. typedef proto::extends<terminal, symbols> base_type;
  416. template <typename Context, typename Unused>
  417. struct attribute
  418. {
  419. typedef Attribute type;
  420. };
  421. symbols(std::string const& name = "symbols")
  422. : base_type(terminal::make(reference_(*this)))
  423. , add(*this)
  424. , remove(*this)
  425. , lookup(new Lookup())
  426. , name_(name)
  427. {}
  428. symbols(symbols const& syms)
  429. : base_type(terminal::make(reference_(*this)))
  430. , add(*this)
  431. , remove(*this)
  432. , lookup(syms.lookup)
  433. , name_(syms.name_)
  434. {}
  435. template <typename CharEncoding_, typename Tag_>
  436. symbols(symbols<Attribute, unused_type, Lookup, CharEncoding_, Tag_> const& syms)
  437. : base_type(terminal::make(reference_(*this)))
  438. , add(*this)
  439. , remove(*this)
  440. , lookup(syms.lookup)
  441. , name_(syms.name_)
  442. {}
  443. template <typename Symbols, typename Data>
  444. symbols(Symbols const& syms, Data const& data
  445. , std::string const& name = "symbols")
  446. : base_type(terminal::make(reference_(*this)))
  447. , add(*this)
  448. , remove(*this)
  449. , lookup(new Lookup())
  450. , name_(name)
  451. {
  452. typename range_const_iterator<Symbols>::type si = boost::begin(syms);
  453. typename range_const_iterator<Data>::type di = boost::begin(data);
  454. while (si != boost::end(syms))
  455. add(*si++, *di++);
  456. }
  457. symbols&
  458. operator=(symbols const& rhs)
  459. {
  460. *lookup = *rhs.lookup;
  461. name_ = rhs.name_;
  462. return *this;
  463. }
  464. template <typename CharEncoding_, typename Tag_>
  465. symbols&
  466. operator=(symbols<Attribute, unused_type, Lookup, CharEncoding_, Tag_> const& rhs)
  467. {
  468. *lookup = *rhs.lookup;
  469. name_ = rhs.name_;
  470. return *this;
  471. }
  472. void clear()
  473. {
  474. lookup->clear();
  475. }
  476. struct adder;
  477. struct remover;
  478. template <typename Attr>
  479. adder const&
  480. operator=(Attr const& attr)
  481. {
  482. lookup->clear();
  483. return add(attr);
  484. }
  485. template <typename Attr>
  486. friend adder const&
  487. operator+= (symbols& sym, Attr const& attr)
  488. {
  489. return sym.add(attr);
  490. }
  491. template <typename Attr>
  492. friend remover const&
  493. operator-= (symbols& sym, Attr const& attr)
  494. {
  495. return sym.remove(attr);
  496. }
  497. // non-const version needed to suppress proto's += kicking in
  498. template <typename Attr>
  499. friend adder const&
  500. operator+= (symbols& sym, Attr& attr)
  501. {
  502. return sym.add(attr);
  503. }
  504. // non-const version needed to suppress proto's -= kicking in
  505. template <typename Attr>
  506. friend remover const&
  507. operator-= (symbols& sym, Attr& attr)
  508. {
  509. return sym.remove(attr);
  510. }
  511. template <typename F>
  512. void for_each(F f) const
  513. {
  514. std::for_each(lookup->begin(), lookup->end(), f);
  515. }
  516. template <typename Attr>
  517. value_type const* find(Attr const& attr)
  518. {
  519. typename Lookup::iterator it = lookup->find(attr);
  520. return (it != lookup->end()) ? &unused : 0;
  521. }
  522. template <typename Attr>
  523. value_type at(Attr const& attr)
  524. {
  525. typename Lookup::iterator it = lookup->find(attr);
  526. if (it == lookup->end())
  527. add(attr);
  528. return unused;
  529. }
  530. ///////////////////////////////////////////////////////////////////////
  531. template <typename OutputIterator, typename Context, typename Delimiter
  532. , typename Attr>
  533. bool generate(OutputIterator& sink, Context&, Delimiter const& d
  534. , Attr const& attr) const
  535. {
  536. typename Lookup::iterator it = lookup->find(
  537. traits::symbols_lookup<Attr, Attribute>::call(attr));
  538. if (it == lookup->end())
  539. return false;
  540. return karma::detail::generate_encoded<CharEncoding, Tag>::
  541. call(sink
  542. , traits::symbols_lookup<Attr, Attribute>::call(attr)
  543. , unused) &&
  544. karma::delimit_out(sink, d);
  545. }
  546. template <typename Context>
  547. info what(Context&) const
  548. {
  549. return info(name_);
  550. }
  551. void name(std::string const &str)
  552. {
  553. name_ = str;
  554. }
  555. std::string const &name() const
  556. {
  557. return name_;
  558. }
  559. ///////////////////////////////////////////////////////////////////////
  560. struct adder
  561. {
  562. template <typename, typename = unused_type>
  563. struct result { typedef adder const& type; };
  564. adder(symbols& sym)
  565. : sym(sym)
  566. {
  567. }
  568. template <typename Attr>
  569. adder const&
  570. operator()(Attr const& attr) const
  571. {
  572. sym.lookup->insert(attr);
  573. return *this;
  574. }
  575. template <typename Attr>
  576. adder const&
  577. operator, (Attr const& attr) const
  578. {
  579. sym.lookup->insert(attr);
  580. return *this;
  581. }
  582. symbols& sym;
  583. // silence MSVC warning C4512: assignment operator could not be generated
  584. BOOST_DELETED_FUNCTION(adder& operator= (adder const&))
  585. };
  586. struct remover
  587. {
  588. template <typename>
  589. struct result { typedef remover const& type; };
  590. remover(symbols& sym)
  591. : sym(sym)
  592. {
  593. }
  594. template <typename Attr>
  595. remover const&
  596. operator()(Attr const& attr) const
  597. {
  598. sym.lookup->erase(attr);
  599. return *this;
  600. }
  601. template <typename Attr>
  602. remover const&
  603. operator, (Attr const& attr) const
  604. {
  605. sym.lookup->erase(attr);
  606. return *this;
  607. }
  608. symbols& sym;
  609. // silence MSVC warning C4512: assignment operator could not be generated
  610. BOOST_DELETED_FUNCTION(remover& operator= (remover const&))
  611. };
  612. adder add;
  613. remover remove;
  614. shared_ptr<Lookup> lookup;
  615. std::string name_;
  616. };
  617. ///////////////////////////////////////////////////////////////////////////
  618. // Generator generators: make_xxx function (objects)
  619. ///////////////////////////////////////////////////////////////////////////
  620. template <typename Attribute, typename T, typename Lookup
  621. , typename CharEnconding, typename Tag, typename Modifiers>
  622. struct make_primitive<
  623. reference<symbols<Attribute, T, Lookup, CharEnconding, Tag> >
  624. , Modifiers>
  625. {
  626. static bool const lower =
  627. has_modifier<Modifiers, tag::char_code_base<tag::lower> >::value;
  628. static bool const upper =
  629. has_modifier<Modifiers, tag::char_code_base<tag::upper> >::value;
  630. typedef reference<
  631. symbols<Attribute, T, Lookup, CharEnconding, Tag>
  632. > reference_;
  633. typedef typename mpl::if_c<
  634. lower || upper
  635. , symbols<
  636. Attribute, T, Lookup
  637. , typename spirit::detail::get_encoding_with_case<
  638. Modifiers, unused_type, lower || upper>::type
  639. , typename detail::get_casetag<Modifiers, lower || upper>::type>
  640. , reference_>::type
  641. result_type;
  642. result_type operator()(reference_ ref, unused_type) const
  643. {
  644. return result_type(ref.ref.get());
  645. }
  646. };
  647. }}}
  648. namespace boost { namespace spirit { namespace traits
  649. {
  650. ///////////////////////////////////////////////////////////////////////////
  651. template <typename Attribute, typename T, typename Lookup
  652. , typename CharEncoding, typename Tag
  653. , typename Attr, typename Context, typename Iterator>
  654. struct handles_container<karma::symbols<Attribute, T, Lookup, CharEncoding, Tag>
  655. , Attr, Context, Iterator>
  656. : traits::is_container<Attr> {};
  657. }}}
  658. #if defined(BOOST_MSVC)
  659. # pragma warning(pop)
  660. #endif
  661. #endif