Andrew Top | 61a8495 | 2019-04-30 15:07:33 -0700 | [diff] [blame] | 1 | // define the module for __config outside of the top level 'std' module |
| 2 | // since __config may be included from C headers which may create an |
| 3 | // include cycle. |
| 4 | module std_config [system] [extern_c] { |
| 5 | header "__config" |
| 6 | } |
| 7 | |
| 8 | module std [system] { |
| 9 | export std_config |
| 10 | // FIXME: The standard does not require that each of these submodules |
| 11 | // re-exports its imported modules. We should provide an alternative form of |
| 12 | // export that issues a warning if a name from the submodule is used, and |
| 13 | // use that to provide a 'strict mode' for libc++. |
| 14 | |
| 15 | // Deprecated C-compatibility headers. These can all be included from within |
| 16 | // an 'extern "C"' context. |
| 17 | module depr [extern_c] { |
| 18 | // <assert.h> provided by C library. |
| 19 | module ctype_h { |
| 20 | header "ctype.h" |
| 21 | export * |
| 22 | } |
| 23 | module errno_h { |
| 24 | header "errno.h" |
| 25 | export * |
| 26 | } |
| 27 | // <fenv.h> provided by C library. |
| 28 | // <float.h> provided by compiler or C library. |
| 29 | module inttypes_h { |
| 30 | header "inttypes.h" |
| 31 | export stdint_h |
| 32 | export * |
| 33 | } |
| 34 | // <iso646.h> provided by compiler. |
| 35 | // <limits.h> provided by compiler or C library. |
| 36 | module locale_h { |
| 37 | header "locale.h" |
| 38 | export * |
| 39 | } |
| 40 | module math_h { |
| 41 | header "math.h" |
| 42 | export * |
| 43 | } |
| 44 | module setjmp_h { |
| 45 | header "setjmp.h" |
| 46 | export * |
| 47 | } |
| 48 | // FIXME: <stdalign.h> is missing. |
| 49 | // <signal.h> provided by C library. |
| 50 | // <stdarg.h> provided by compiler. |
| 51 | // <stdbool.h> provided by compiler. |
| 52 | module stddef_h { |
| 53 | // <stddef.h>'s __need_* macros require textual inclusion. |
| 54 | textual header "stddef.h" |
| 55 | } |
| 56 | module stdint_h { |
| 57 | header "stdint.h" |
| 58 | export * |
| 59 | // FIXME: This module only exists on OS X and for some reason the |
| 60 | // wildcard above doesn't export it. |
| 61 | export Darwin.C.stdint |
| 62 | } |
| 63 | module stdio_h { |
| 64 | // <stdio.h>'s __need_* macros require textual inclusion. |
| 65 | textual header "stdio.h" |
| 66 | export * |
| 67 | export Darwin.C.stdio |
| 68 | } |
| 69 | module stdlib_h { |
| 70 | // <stdlib.h>'s __need_* macros require textual inclusion. |
| 71 | textual header "stdlib.h" |
| 72 | export * |
| 73 | } |
| 74 | module string_h { |
| 75 | header "string.h" |
| 76 | export * |
| 77 | } |
| 78 | // FIXME: <uchar.h> is missing. |
| 79 | // <time.h> provided by C library. |
| 80 | module wchar_h { |
| 81 | // <wchar.h>'s __need_* macros require textual inclusion. |
| 82 | textual header "wchar.h" |
| 83 | export * |
| 84 | } |
| 85 | module wctype_h { |
| 86 | header "wctype.h" |
| 87 | export * |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | // <complex.h> and <tgmath.h> are not C headers in any real sense, do not |
| 92 | // allow their use in extern "C" contexts. |
| 93 | module complex_h { |
| 94 | header "complex.h" |
| 95 | export ccomplex |
| 96 | export * |
| 97 | } |
| 98 | module tgmath_h { |
| 99 | header "tgmath.h" |
| 100 | export ccomplex |
| 101 | export cmath |
| 102 | export * |
| 103 | } |
| 104 | |
| 105 | // C compatibility headers. |
| 106 | module compat { |
| 107 | module cassert { |
| 108 | // <cassert>'s use of NDEBUG requires textual inclusion. |
| 109 | textual header "cassert" |
| 110 | } |
| 111 | module ccomplex { |
| 112 | header "ccomplex" |
| 113 | export complex |
| 114 | export * |
| 115 | } |
| 116 | module cctype { |
| 117 | header "cctype" |
| 118 | export * |
| 119 | } |
| 120 | module cerrno { |
| 121 | header "cerrno" |
| 122 | export * |
| 123 | } |
| 124 | module cfenv { |
| 125 | header "cfenv" |
| 126 | export * |
| 127 | } |
| 128 | module cfloat { |
| 129 | header "cfloat" |
| 130 | export * |
| 131 | } |
| 132 | module cinttypes { |
| 133 | header "cinttypes" |
| 134 | export cstdint |
| 135 | export * |
| 136 | } |
| 137 | module ciso646 { |
| 138 | header "ciso646" |
| 139 | export * |
| 140 | } |
| 141 | module climits { |
| 142 | header "climits" |
| 143 | export * |
| 144 | } |
| 145 | module clocale { |
| 146 | header "clocale" |
| 147 | export * |
| 148 | } |
| 149 | module cmath { |
| 150 | header "cmath" |
| 151 | export * |
| 152 | } |
| 153 | module csetjmp { |
| 154 | header "csetjmp" |
| 155 | export * |
| 156 | } |
| 157 | module csignal { |
| 158 | header "csignal" |
| 159 | export * |
| 160 | } |
| 161 | // FIXME: <cstdalign> is missing. |
| 162 | module cstdarg { |
| 163 | header "cstdarg" |
| 164 | export * |
| 165 | } |
| 166 | module cstdbool { |
| 167 | header "cstdbool" |
| 168 | export * |
| 169 | } |
| 170 | module cstddef { |
| 171 | header "cstddef" |
| 172 | export * |
| 173 | } |
| 174 | module cstdint { |
| 175 | header "cstdint" |
| 176 | export depr.stdint_h |
| 177 | export * |
| 178 | } |
| 179 | module cstdio { |
| 180 | header "cstdio" |
| 181 | export * |
| 182 | } |
| 183 | module cstdlib { |
| 184 | header "cstdlib" |
| 185 | export * |
| 186 | } |
| 187 | module cstring { |
| 188 | header "cstring" |
| 189 | export * |
| 190 | } |
| 191 | module ctgmath { |
| 192 | header "ctgmath" |
| 193 | export ccomplex |
| 194 | export cmath |
| 195 | export * |
| 196 | } |
| 197 | module ctime { |
| 198 | header "ctime" |
| 199 | export * |
| 200 | } |
| 201 | // FIXME: <cuchar> is missing. |
| 202 | module cwchar { |
| 203 | header "cwchar" |
| 204 | export depr.stdio_h |
| 205 | export * |
| 206 | } |
| 207 | module cwctype { |
| 208 | header "cwctype" |
| 209 | export * |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | module algorithm { |
| 214 | header "algorithm" |
| 215 | export initializer_list |
| 216 | export * |
| 217 | } |
| 218 | module any { |
| 219 | header "any" |
| 220 | export * |
| 221 | } |
| 222 | module array { |
| 223 | header "array" |
| 224 | export initializer_list |
| 225 | export * |
| 226 | } |
| 227 | module atomic { |
| 228 | header "atomic" |
| 229 | export * |
| 230 | } |
| 231 | module bitset { |
| 232 | header "bitset" |
| 233 | export string |
| 234 | export iosfwd |
| 235 | export * |
| 236 | } |
| 237 | // No submodule for cassert. It fundamentally needs repeated, textual inclusion. |
| 238 | module charconv { |
| 239 | header "charconv" |
| 240 | export * |
| 241 | } |
| 242 | module chrono { |
| 243 | header "chrono" |
| 244 | export * |
| 245 | } |
| 246 | module codecvt { |
| 247 | header "codecvt" |
| 248 | export * |
| 249 | } |
| 250 | module compare { |
| 251 | header "compare" |
| 252 | export * |
| 253 | } |
| 254 | module complex { |
| 255 | header "complex" |
| 256 | export * |
| 257 | } |
| 258 | module condition_variable { |
| 259 | header "condition_variable" |
| 260 | export * |
| 261 | } |
| 262 | module deque { |
| 263 | header "deque" |
| 264 | export initializer_list |
| 265 | export * |
| 266 | } |
| 267 | module exception { |
| 268 | header "exception" |
| 269 | export * |
| 270 | } |
| 271 | module filesystem { |
| 272 | header "filesystem" |
| 273 | export * |
| 274 | } |
| 275 | module forward_list { |
| 276 | header "forward_list" |
| 277 | export initializer_list |
| 278 | export * |
| 279 | } |
| 280 | module fstream { |
| 281 | header "fstream" |
| 282 | export * |
| 283 | } |
| 284 | module functional { |
| 285 | header "functional" |
| 286 | export * |
| 287 | } |
| 288 | module future { |
| 289 | header "future" |
| 290 | export * |
| 291 | } |
| 292 | module initializer_list { |
| 293 | header "initializer_list" |
| 294 | export * |
| 295 | } |
| 296 | module iomanip { |
| 297 | header "iomanip" |
| 298 | export * |
| 299 | } |
| 300 | module ios { |
| 301 | header "ios" |
| 302 | export iosfwd |
| 303 | export * |
| 304 | } |
| 305 | module iosfwd { |
| 306 | header "iosfwd" |
| 307 | export * |
| 308 | } |
| 309 | module iostream { |
| 310 | header "iostream" |
| 311 | export ios |
| 312 | export streambuf |
| 313 | export istream |
| 314 | export ostream |
| 315 | export * |
| 316 | } |
| 317 | module istream { |
| 318 | header "istream" |
| 319 | // FIXME: should re-export ios, streambuf? |
| 320 | export * |
| 321 | } |
| 322 | module iterator { |
| 323 | header "iterator" |
| 324 | export * |
| 325 | } |
| 326 | module limits { |
| 327 | header "limits" |
| 328 | export * |
| 329 | } |
| 330 | module list { |
| 331 | header "list" |
| 332 | export initializer_list |
| 333 | export * |
| 334 | } |
| 335 | module locale { |
| 336 | header "locale" |
| 337 | export * |
| 338 | } |
| 339 | module map { |
| 340 | header "map" |
| 341 | export initializer_list |
| 342 | export * |
| 343 | } |
| 344 | module memory { |
| 345 | header "memory" |
| 346 | export * |
| 347 | } |
| 348 | module mutex { |
| 349 | header "mutex" |
| 350 | export * |
| 351 | } |
| 352 | module new { |
| 353 | header "new" |
| 354 | export * |
| 355 | } |
| 356 | module numeric { |
| 357 | header "numeric" |
| 358 | export * |
| 359 | } |
| 360 | module optional { |
| 361 | header "optional" |
| 362 | export * |
| 363 | } |
| 364 | module ostream { |
| 365 | header "ostream" |
| 366 | // FIXME: should re-export ios, streambuf? |
| 367 | export * |
| 368 | } |
| 369 | module queue { |
| 370 | header "queue" |
| 371 | export initializer_list |
| 372 | export * |
| 373 | } |
| 374 | module random { |
| 375 | header "random" |
| 376 | export initializer_list |
| 377 | export * |
| 378 | } |
| 379 | module ratio { |
| 380 | header "ratio" |
| 381 | export * |
| 382 | } |
| 383 | module regex { |
| 384 | header "regex" |
| 385 | export initializer_list |
| 386 | export * |
| 387 | } |
| 388 | module scoped_allocator { |
| 389 | header "scoped_allocator" |
| 390 | export * |
| 391 | } |
| 392 | module set { |
| 393 | header "set" |
| 394 | export initializer_list |
| 395 | export * |
| 396 | } |
| 397 | module sstream { |
| 398 | header "sstream" |
| 399 | // FIXME: should re-export istream, ostream, ios, streambuf, string? |
| 400 | export * |
| 401 | } |
| 402 | module stack { |
| 403 | header "stack" |
| 404 | export initializer_list |
| 405 | export * |
| 406 | } |
| 407 | module stdexcept { |
| 408 | header "stdexcept" |
| 409 | export * |
| 410 | } |
| 411 | module streambuf { |
| 412 | header "streambuf" |
| 413 | export * |
| 414 | } |
| 415 | module string { |
| 416 | header "string" |
| 417 | export initializer_list |
| 418 | export string_view |
| 419 | export __string |
| 420 | export * |
| 421 | } |
| 422 | module string_view { |
| 423 | header "string_view" |
| 424 | export initializer_list |
| 425 | export __string |
| 426 | export * |
| 427 | } |
| 428 | module strstream { |
| 429 | header "strstream" |
| 430 | export * |
| 431 | } |
| 432 | module system_error { |
| 433 | header "system_error" |
| 434 | export * |
| 435 | } |
| 436 | module thread { |
| 437 | header "thread" |
| 438 | export * |
| 439 | } |
| 440 | module tuple { |
| 441 | header "tuple" |
| 442 | export * |
| 443 | } |
| 444 | module type_traits { |
| 445 | header "type_traits" |
| 446 | export * |
| 447 | } |
| 448 | module typeindex { |
| 449 | header "typeindex" |
| 450 | export * |
| 451 | } |
| 452 | module typeinfo { |
| 453 | header "typeinfo" |
| 454 | export * |
| 455 | } |
| 456 | module unordered_map { |
| 457 | header "unordered_map" |
| 458 | export initializer_list |
| 459 | export * |
| 460 | } |
| 461 | module unordered_set { |
| 462 | header "unordered_set" |
| 463 | export initializer_list |
| 464 | export * |
| 465 | } |
| 466 | module utility { |
| 467 | header "utility" |
| 468 | export initializer_list |
| 469 | export * |
| 470 | } |
| 471 | module valarray { |
| 472 | header "valarray" |
| 473 | export initializer_list |
| 474 | export * |
| 475 | } |
| 476 | module variant { |
| 477 | header "variant" |
| 478 | export * |
| 479 | } |
| 480 | module vector { |
| 481 | header "vector" |
| 482 | export initializer_list |
| 483 | export * |
| 484 | } |
| 485 | module version { |
| 486 | header "version" |
| 487 | export * |
| 488 | } |
| 489 | |
| 490 | // FIXME: These should be private. |
| 491 | module __bit_reference { header "__bit_reference" export * } |
| 492 | module __debug { header "__debug" export * } |
| 493 | module __errc { header "__errc" export * } |
| 494 | module __functional_base { header "__functional_base" export * } |
| 495 | module __hash_table { header "__hash_table" export * } |
| 496 | module __locale { header "__locale" export * } |
| 497 | module __mutex_base { header "__mutex_base" export * } |
| 498 | module __split_buffer { header "__split_buffer" export * } |
| 499 | module __sso_allocator { header "__sso_allocator" export * } |
| 500 | module __std_stream { header "__std_stream" export * } |
| 501 | module __string { header "__string" export * } |
| 502 | module __tree { header "__tree" export * } |
| 503 | module __tuple { header "__tuple" export * } |
| 504 | module __undef_macros { header "__undef_macros" export * } |
| 505 | module __node_handle { header "__node_handle" export * } |
| 506 | |
| 507 | module experimental { |
| 508 | requires cplusplus11 |
| 509 | |
| 510 | module algorithm { |
| 511 | header "experimental/algorithm" |
| 512 | export * |
| 513 | } |
| 514 | module coroutine { |
| 515 | requires coroutines |
| 516 | header "experimental/coroutine" |
| 517 | export * |
| 518 | } |
| 519 | module deque { |
| 520 | header "experimental/deque" |
| 521 | export * |
| 522 | } |
| 523 | module dynarray { |
| 524 | header "experimental/dynarray" |
| 525 | export * |
| 526 | } |
| 527 | module filesystem { |
| 528 | header "experimental/filesystem" |
| 529 | export * |
| 530 | } |
| 531 | module forward_list { |
| 532 | header "experimental/forward_list" |
| 533 | export * |
| 534 | } |
| 535 | module functional { |
| 536 | header "experimental/functional" |
| 537 | export * |
| 538 | } |
| 539 | module iterator { |
| 540 | header "experimental/iterator" |
| 541 | export * |
| 542 | } |
| 543 | module list { |
| 544 | header "experimental/list" |
| 545 | export * |
| 546 | } |
| 547 | module map { |
| 548 | header "experimental/map" |
| 549 | export * |
| 550 | } |
| 551 | module memory_resource { |
| 552 | header "experimental/memory_resource" |
| 553 | export * |
| 554 | } |
| 555 | module propagate_const { |
| 556 | header "experimental/propagate_const" |
| 557 | export * |
| 558 | } |
| 559 | module regex { |
| 560 | header "experimental/regex" |
| 561 | export * |
| 562 | } |
| 563 | module simd { |
| 564 | header "experimental/simd" |
| 565 | export * |
| 566 | } |
| 567 | module set { |
| 568 | header "experimental/set" |
| 569 | export * |
| 570 | } |
| 571 | module span { |
| 572 | header "span" |
| 573 | export * |
| 574 | } |
| 575 | module string { |
| 576 | header "experimental/string" |
| 577 | export * |
| 578 | } |
| 579 | module type_traits { |
| 580 | header "experimental/type_traits" |
| 581 | export * |
| 582 | } |
| 583 | module unordered_map { |
| 584 | header "experimental/unordered_map" |
| 585 | export * |
| 586 | } |
| 587 | module unordered_set { |
| 588 | header "experimental/unordered_set" |
| 589 | export * |
| 590 | } |
| 591 | module utility { |
| 592 | header "experimental/utility" |
| 593 | export * |
| 594 | } |
| 595 | module vector { |
| 596 | header "experimental/vector" |
| 597 | export * |
| 598 | } |
| 599 | // FIXME these should be private |
| 600 | module __memory { |
| 601 | header "experimental/__memory" |
| 602 | export * |
| 603 | } |
| 604 | } // end experimental |
| 605 | } |