@@ -600,6 +600,23 @@ $(H2 $(LNAME2 gnu-clang-extensions, Gnu and Clang Extensions))
600
600
$(P `gcc` and `clang` are presumed to have the same behavior w.r.t. extensions,
601
601
so `gcc` as used here refers to both.)
602
602
603
+
604
+ $(H3 $(LNAME2 __attribute__, `__attribute__` Extensions))
605
+
606
+ $(P The following $(LINK2 https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html, `__attribute__` extensions):)
607
+
608
+ $(OL
609
+ $(LI `__attribute__((aligned(N)))`)
610
+ $(LI `__attribute__((always_inline))`)
611
+ $(LI `__attribute__((deprecated))`)
612
+ $(LI `__attribute__((dllexport))`)
613
+ $(LI `__attribute__((dllimport))`)
614
+ $(LI `__attribute__((naked))`)
615
+ $(LI `__attribute__((noinline))`)
616
+ $(LI $(RELATIVE_LINK2 noreturn, `__attribute__((noreturn))`))
617
+ $(LI others are ignored)
618
+ )
619
+
603
620
$(H3 $(LNAME2 noreturn, `__attribute__((noreturn))`))
604
621
605
622
$(P `__attribute__((noreturn))` marks a function as never returning.
@@ -628,16 +645,46 @@ $(H2 $(LNAME2 visualc-extensions, Visual C Extensions))
628
645
629
646
$(P All the $(RELATIVE_LINK2 digital-mars-extensions, Digital Mars C Extensions).)
630
647
631
- $(H2 $(LNAME2 digital-mars-extensions, Digital Mars C Extensions))
632
-
633
648
$(H3 $(LNAME2 __stdcall, `__stdcall` Function Calling Convention))
634
649
635
- $(P This sets the calling convention for a function to the Windows API calling convention.)
650
+ $(P `__stdcall` sets the calling convention for a function to the Windows API calling convention.)
636
651
637
652
---
638
653
int __stdcall foo(int x);
639
654
---
640
655
656
+ $(H3 $(LNAME2 __declspec, `__declspec` Attribute Extensions))
657
+
658
+ $(P The following $(LINK2 https://learn.microsoft.com/en-us/cpp/cpp/declspec?view=msvc-170, `__declspec` extensions):)
659
+
660
+ $(OL
661
+ $(LI `__declspec(align(N))`)
662
+ $(LI `__declspec(deprecated)`)
663
+ $(LI `__declspec(dllexport)`)
664
+ $(LI `__declspec(dllimport)`)
665
+ $(LI `__declspec(naked)`)
666
+ $(LI `__declspec(noinline)`)
667
+ $(LI `__declspec(noreturn)`)
668
+ $(LI `__declspec(thread)`)
669
+ $(LI others are ignored)
670
+ )
671
+
672
+ $(H2 $(LNAME2 digital-mars-extensions, Digital Mars C Extensions))
673
+
674
+ $(H3 $(LNAME2 __stdcall, `__stdcall` Function Calling Convention))
675
+
676
+ $(H3 $(LNAME2 __declspec, `__declspec` Attribute Extensions))
677
+
678
+ $(P The following $(LINK2 https://digitalmars.com/ctg/ctgLanguageImplementation.html#declspec, `__declspec` extensions):)
679
+
680
+ $(OL
681
+ $(LI `__declspec(dllexport)`)
682
+ $(LI `__declspec(dllimport)`)
683
+ $(LI `__declspec(naked)`)
684
+ $(LI `__declspec(thread)`)
685
+ )
686
+
687
+
641
688
$(H2 $(LNAME2 d-side, ImportC from D's Point of View))
642
689
643
690
$(P There is no one-to-one mapping of C constructs to D constructs, although
0 commit comments