summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-06-19 17:32:39 +0200
committerPhilip Rauwolf <rauwolf@itestra.de>2013-07-01 18:18:44 +0200
commitec32b9332ab756d9d4f5b4c2144cbd5419efb01a (patch)
treef937056590b14fa99f611609deb0fe4bd83a9636
parentee14eb1e1c37dc82673da1004324eca20a463b0f (diff)
downloadgenivi-common-api-runtime-ec32b9332ab756d9d4f5b4c2144cbd5419efb01a.tar.gz
Resolved some potential memory corruption issues when dynamically loading generated code. Also eliminated compile time warnings on redefinitions.
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceGenerator.xtend5
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceProxyGenerator.xtend4
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend2
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCollectionGenerator.xtend5
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeGenerator.xtend2
5 files changed, 15 insertions, 3 deletions
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceGenerator.xtend
index 790d614..4c175d2 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceGenerator.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceGenerator.xtend
@@ -38,7 +38,9 @@ class FInterfaceGenerator {
#include <«requiredHeaderFile»>
«ENDFOR»
+ #if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
+ #endif
«FOR requiredHeaderFile : libraryHeaders.sort»
#include <«requiredHeaderFile»>
@@ -58,7 +60,8 @@ class FInterfaceGenerator {
};
const char* «fInterface.name»::getInterfaceId() {
- return "«fInterface.fullyQualifiedName»";
+ static const char* interfaceId = "«fInterface.fullyQualifiedName»";
+ return interfaceId;
}
CommonAPI::Version «fInterface.name»::getInterfaceVersion() {
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceProxyGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceProxyGenerator.xtend
index 185b369..653ae49 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceProxyGenerator.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceProxyGenerator.xtend
@@ -43,7 +43,9 @@ class FInterfaceProxyGenerator {
#include <«requiredHeaderFile»>
«ENDFOR»
+ #if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
+ #endif
«FOR requiredHeaderFile : libraryHeaders.sort»
#include <«requiredHeaderFile»>
@@ -118,7 +120,9 @@ class FInterfaceProxyGenerator {
#include "«fInterface.proxyBaseHeaderFile»"
+ #if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
+ #endif
«IF fInterface.hasAttributes»
#include <CommonAPI/AttributeExtension.h>
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend
index 19b66fc..ab6ab41 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend
@@ -38,7 +38,9 @@ class FInterfaceStubGenerator {
#include "«fInterface.name».h"
+ #if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
+ #endif
«FOR requiredHeaderFile : libraryHeaders.sort»
#include <«requiredHeaderFile»>
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCollectionGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCollectionGenerator.xtend
index 81b189d..edf4c51 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCollectionGenerator.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCollectionGenerator.xtend
@@ -39,7 +39,9 @@ class FTypeCollectionGenerator {
#include <«requiredHeaderFile»>
«ENDFOR»
+ #if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
+ #endif
«FOR requiredHeaderFile : libraryHeaders.sort»
#include <«requiredHeaderFile»>
@@ -58,7 +60,8 @@ class FTypeCollectionGenerator {
static inline const char* getTypeCollectionName() {
- return "«fTypeCollection.fullyQualifiedName»";
+ static const char* typeCollectionName = "«fTypeCollection.fullyQualifiedName»";
+ return typeCollectionName;
}
«IF fTypeCollection.version != null»
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeGenerator.xtend
index 2d0ca2e..62a9032 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeGenerator.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeGenerator.xtend
@@ -137,7 +137,7 @@ class FTypeGenerator {
«ENDFOR»
};
- // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1
+ // Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1
struct «name»Comparator;
'''