Browse Source

fixing amalgamation for subscriptions by carefull changing of guards and resorting of headers

Stasik0 9 years ago
parent
commit
13963238e3
3 changed files with 9 additions and 5 deletions
  1. 6 2
      CMakeLists.txt
  2. 1 1
      src/server/ua_subscription.h
  3. 2 2
      src/server/ua_subscription_manager.h

+ 6 - 2
CMakeLists.txt

@@ -67,8 +67,8 @@ set(internal_headers ${PROJECT_SOURCE_DIR}/src/ua_util.h
                      ${PROJECT_BINARY_DIR}/src_generated/ua_transport_generated.h
                      ${PROJECT_SOURCE_DIR}/src/ua_types_encoding_binary.h
                      ${PROJECT_SOURCE_DIR}/src/ua_securechannel.h
-                     ${PROJECT_SOURCE_DIR}/src/ua_session.h
                      ${PROJECT_SOURCE_DIR}/src/server/ua_nodes.h
+                     ${PROJECT_SOURCE_DIR}/src/ua_session.h
                      ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore.h
                      ${PROJECT_SOURCE_DIR}/src/server/ua_session_manager.h
                      ${PROJECT_SOURCE_DIR}/src/server/ua_securechannel_manager.h
@@ -108,7 +108,11 @@ if(ENABLE_SUBSCRIPTIONS)
   list(APPEND lib_sources ${PROJECT_SOURCE_DIR}/src/server/ua_services_subscription.c
                           ${PROJECT_SOURCE_DIR}/src/server/ua_subscription.c
                           ${PROJECT_SOURCE_DIR}/src/server/ua_subscription_manager.c)
-
+  ##append subscription headers at before ua_session.
+  list(FIND internal_headers "${PROJECT_SOURCE_DIR}/src/ua_session.h" UaSessionPos)
+  list(INSERT internal_headers  ${UaSessionPos} ${PROJECT_SOURCE_DIR}/src/server/ua_subscription.h
+                          ${PROJECT_SOURCE_DIR}/src/server/ua_subscription_manager.h)
+                          
   add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.c
                             ${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h
                      PRE_BUILD

+ 1 - 1
src/server/ua_subscription.h

@@ -96,4 +96,4 @@ void Subscription_copyTopNotificationMessage(UA_NotificationMessage *dst, UA_Sub
 UA_UInt32 Subscription_deleteUnpublishedNotification(UA_UInt32 seqNo, UA_Subscription *sub);
 void Subscription_generateKeepAlive(UA_Subscription *subscription);
 
-#endif //UA_SUBSCRIPTION_H_
+#endif /* UA_SUBSCRIPTION_H_ */

+ 2 - 2
src/server/ua_subscription_manager.h

@@ -7,7 +7,7 @@
 #include "ua_nodestore.h"
 #include "ua_subscription.h"
 
-typedef struct UA_SubscriptionManager_s {
+typedef struct UA_SubscriptionManager {
     UA_Int32_BoundedValue    GlobalPublishingInterval;
     UA_UInt32_BoundedValue   GlobalLifeTimeCount;
     UA_UInt32_BoundedValue   GlobalKeepAliveCount;
@@ -27,4 +27,4 @@ UA_Int32 SubscriptionManager_deleteSubscription(UA_SubscriptionManager *manager,
 UA_Int32 SubscriptionManager_deleteMonitoredItem(UA_SubscriptionManager *manager, UA_Int32 SubscriptionID,
                                                  UA_UInt32 MonitoredItemID);
 
-#endif  // ifndef... define UA_SUBSCRIPTION_MANAGER_H_
+#endif /* UA_SUBSCRIPTION_MANAGER_H_ */