summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-12 18:12:50 -0500
committermidipix <writeonce@midipix.org>2016-12-12 18:12:50 -0500
commitc27e28f396cc0f40d1dbfc9b13996d100563c14a (patch)
treeba9d6fcd1f6ac90d48d263c515e73d7d4beda462 /include
parent8f1be0391590788386ba86fc1322ef0f79d6dd05 (diff)
downloadpsxtypes-c27e28f396cc0f40d1dbfc9b13996d100563c14a.tar.bz2
psxtypes-c27e28f396cc0f40d1dbfc9b13996d100563c14a.tar.xz
named section support: fix foreign compiler defs., add freestd convenience.
Diffstat (limited to 'include')
-rw-r--r--include/psxtypes/compiler/__nt_compiler_gcc.h6
-rw-r--r--include/psxtypes/compiler/__nt_compiler_msvc.h7
-rw-r--r--include/psxtypes/compiler/__psx_compiler_gcc.h6
-rw-r--r--include/psxtypes/section/freestd.h3
4 files changed, 19 insertions, 3 deletions
diff --git a/include/psxtypes/compiler/__nt_compiler_gcc.h b/include/psxtypes/compiler/__nt_compiler_gcc.h
index b145698..5eb49a0 100644
--- a/include/psxtypes/compiler/__nt_compiler_gcc.h
+++ b/include/psxtypes/compiler/__nt_compiler_gcc.h
@@ -61,7 +61,6 @@
/* compiler attributes */
#define __attr_aligned__(x) __attribute__((__aligned__(x)))
#define __attr_ptr_size_aligned__ __attr_aligned__(__SIZEOF_POINTER__)
-#define __attr_section__(s) __attribute__((section(s)))
#define __attr_packed__ __attribute__((__packed__))
#define __attr_export__ __attribute__((dllexport))
#define __attr_import__ __attribute__((dllimport))
@@ -79,6 +78,11 @@
#endif
+/* named section support */
+#define __attr_section__(s) __attribute__((section(s)))
+#define __attr_section_decl__(s)
+
+
/* compiler-dependent assertions */
#define __assert_aligned_size(s,a) typedef char __assert##s [-(sizeof(s) % a)]
#define __assert_struct_size(s1,s2) typedef char __assert##s1##s2 [sizeof(s2) -sizeof(s1)]
diff --git a/include/psxtypes/compiler/__nt_compiler_msvc.h b/include/psxtypes/compiler/__nt_compiler_msvc.h
index 5268a0e..47aca32 100644
--- a/include/psxtypes/compiler/__nt_compiler_msvc.h
+++ b/include/psxtypes/compiler/__nt_compiler_msvc.h
@@ -72,7 +72,6 @@
#define __volatile__ volatile
#define __attr_aligned__(x) __declspec(align(x))
#define __attr_ptr_size_aligned__ __attr_aligned__(__SIZEOF_POINTER__)
-#define __attr_section__(s) __declspec(allocate(s))
#define __attr_packed__
#define __attr_export__ __declspec(dllexport)
#define __attr_import__ __declspec(dllimport)
@@ -90,6 +89,12 @@
#endif
+/* named section support */
+#define __attr_section__(s)
+#define __attr_section_decl__(s) __declspec(allocate(s))
+#define __SECTION_PRAGMA_REQUIRED__
+
+
/* compiler-dependent assertions */
#define __assert_aligned_size(s,a) typedef char __assert##s [1-((sizeof(s) % a))]
#define __assert_struct_size(s1,s2) typedef char __assert##s1##s2 [1 + sizeof(s2) -sizeof(s1)]
diff --git a/include/psxtypes/compiler/__psx_compiler_gcc.h b/include/psxtypes/compiler/__psx_compiler_gcc.h
index 94baa9f..5995bf1 100644
--- a/include/psxtypes/compiler/__psx_compiler_gcc.h
+++ b/include/psxtypes/compiler/__psx_compiler_gcc.h
@@ -53,7 +53,6 @@
/* compiler attributes */
#define __attr_aligned__(x) __attribute__((__aligned__(x)))
#define __attr_ptr_size_aligned__ __attr_aligned__(__SIZEOF_POINTER__)
-#define __attr_section__(s) __attribute__((section(s)))
#define __attr_packed__ __attribute__((__packed__))
#define __attr_export__ __attribute__((dllexport))
#define __attr_import__ __attribute__((dllimport))
@@ -64,6 +63,11 @@
#define __attr_protected__ __attribute__ ((visibility("protected")))
+/* named section support */
+#define __attr_section__(s) __attribute__((section(s)))
+#define __attr_section_decl__(s)
+
+
/* compiler-dependent assertions */
#define __assert_aligned_size(s,a) typedef char __assert##s [-(sizeof(s) % a)]
#define __assert_struct_size(s1,s2) typedef char __assert##s1##s2 [sizeof(s2) -sizeof(s1)]
diff --git a/include/psxtypes/section/freestd.h b/include/psxtypes/section/freestd.h
new file mode 100644
index 0000000..f1ed4a6
--- /dev/null
+++ b/include/psxtypes/section/freestd.h
@@ -0,0 +1,3 @@
+#ifdef __SECTION_PRAGMA_REQUIRED__
+#pragma section(".freestd",read)
+#endif