aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-06-09 20:33:13 +0000
committerlloyd <[email protected]>2010-06-09 20:33:13 +0000
commit3cb071d6a049ad5f8108e054a19f3bf0ceddb7b6 (patch)
tree047c216a7d51ece52e7dee53c382098ff726661a /src
parent6d0ee25e9464015e44601d87f48e253d99834b1f (diff)
Use using directives to bring parent members of vector types into
scope; this affects Clang and some older GCCs. Add build support for Clang compiler (untested).
Diffstat (limited to 'src')
-rw-r--r--src/alloc/secmem.h31
-rw-r--r--src/build-data/cc/clang.txt42
2 files changed, 63 insertions, 10 deletions
diff --git a/src/alloc/secmem.h b/src/alloc/secmem.h
index d64a376ca..a5c1362ce 100644
--- a/src/alloc/secmem.h
+++ b/src/alloc/secmem.h
@@ -301,6 +301,10 @@ template<typename T>
class MemoryVector : public MemoryRegion<T>
{
public:
+ using MemoryRegion<T>::set;
+ using MemoryRegion<T>::init;
+ using MemoryRegion<T>::append;
+
/**
* Copy the contents of another buffer into this buffer.
* @param in the buffer to copy the contents from
@@ -314,7 +318,7 @@ class MemoryVector : public MemoryRegion<T>
* @param n the length of the buffer to create.
*/
- MemoryVector(u32bit n = 0) { MemoryRegion<T>::init(false, n); }
+ MemoryVector(u32bit n = 0) { init(false, n); }
/**
* Create a buffer with the specified contents.
@@ -323,13 +327,13 @@ class MemoryVector : public MemoryRegion<T>
* @param n the size of the arry in
*/
MemoryVector(const T in[], u32bit n)
- { MemoryRegion<T>::init(false); set(in, n); }
+ { init(false); set(in, n); }
/**
* Copy constructor.
*/
MemoryVector(const MemoryRegion<T>& in)
- { MemoryRegion<T>::init(false); set(in); }
+ { init(false); set(in); }
/**
* Create a buffer whose content is the concatenation of two other
@@ -338,7 +342,7 @@ class MemoryVector : public MemoryRegion<T>
* @param in2 the contents to be appended to in1
*/
MemoryVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2)
- { MemoryRegion<T>::init(false); set(in1); append(in2); }
+ { init(false); set(in1); append(in2); }
};
/**
@@ -353,6 +357,10 @@ template<typename T>
class SecureVector : public MemoryRegion<T>
{
public:
+ using MemoryRegion<T>::set;
+ using MemoryRegion<T>::init;
+ using MemoryRegion<T>::append;
+
/**
* Copy the contents of another buffer into this buffer.
* @param in the buffer to copy the contents from
@@ -366,7 +374,7 @@ class SecureVector : public MemoryRegion<T>
* @param n the length of the buffer to create.
*/
- SecureVector(u32bit n = 0) { MemoryRegion<T>::init(true, n); }
+ SecureVector(u32bit n = 0) { init(true, n); }
/**
* Create a buffer with the specified contents.
@@ -375,7 +383,7 @@ class SecureVector : public MemoryRegion<T>
* @param n the size of the array in
*/
SecureVector(const T in[], u32bit n)
- { MemoryRegion<T>::init(true); set(in, n); }
+ { init(true); set(in, n); }
/**
* Create a buffer with contents specified contents.
@@ -383,7 +391,7 @@ class SecureVector : public MemoryRegion<T>
* copied into the newly created buffer.
*/
SecureVector(const MemoryRegion<T>& in)
- { MemoryRegion<T>::init(true); set(in); }
+ { init(true); set(in); }
/**
* Create a buffer whose content is the concatenation of two other
@@ -392,7 +400,7 @@ class SecureVector : public MemoryRegion<T>
* @param in2 the contents to be appended to in1
*/
SecureVector(const MemoryRegion<T>& in1, const MemoryRegion<T>& in2)
- { MemoryRegion<T>::init(true); set(in1); append(in2); }
+ { init(true); set(in1); append(in2); }
};
/**
@@ -407,6 +415,9 @@ template<typename T, u32bit L>
class SecureBuffer : public MemoryRegion<T>
{
public:
+ using MemoryRegion<T>::set;
+ using MemoryRegion<T>::init;
+
/**
* Copy the contents of another buffer into this buffer.
* @param in the buffer to copy the contents from
@@ -418,7 +429,7 @@ class SecureBuffer : public MemoryRegion<T>
/**
* Create a buffer of the length L.
*/
- SecureBuffer() { MemoryRegion<T>::init(true, L); }
+ SecureBuffer() { init(true, L); }
/**
* Create a buffer of size L with the specified contents.
@@ -427,7 +438,7 @@ class SecureBuffer : public MemoryRegion<T>
* @param n the size of the array in
*/
SecureBuffer(const T in[], u32bit n)
- { MemoryRegion<T>::init(true, L); copy(in, n); }
+ { init(true, L); copy(in, n); }
private:
SecureBuffer<T, L>& operator=(const MemoryRegion<T>& in)
{ if(this != &in) set(in); return (*this); }
diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt
new file mode 100644
index 000000000..e79893beb
--- /dev/null
+++ b/src/build-data/cc/clang.txt
@@ -0,0 +1,42 @@
+# Largely copied from the gcc config
+
+binary_name clang
+
+compile_option "-c "
+output_to_option "-o "
+add_include_dir_option -I
+add_lib_dir_option -L
+add_lib_option -l
+
+lang_flags "-D_REENTRANT -ansi -Wno-long-long"
+warning_flags "-W -Wall"
+
+makefile_style unix
+
+lib_opt_flags "-O2"
+check_opt_flags "-O2"
+shared_flags "-fPIC"
+debug_flags -g
+no_debug_flags "-finline-functions"
+
+<so_link_flags>
+# The default works for GNU ld and several other Unix linkers
+default -> "$(CXX) -shared -fPIC -Wl,-soname,$(SONAME)"
+</so_link_flags>
+
+<mach_abi_linking>
+amd64 -> "-m64"
+mips64 -> "-mabi=64"
+s390 -> "-m31"
+s390x -> "-m64"
+sparc32 -> "-m32 -mno-app-regs"
+sparc64 -> "-m64 -mno-app-regs"
+ppc64 -> "-m64"
+
+# This should probably be used on most/all targets, but the docs are incomplete
+openbsd -> "-pthread"
+freebsd -> "-pthread"
+dragonfly -> "-pthread"
+netbsd -> "-pthread -D_NETBSD_SOURCE"
+qnx -> "-fexceptions -D_QNX_SOURCE"
+</mach_abi_linking>