Browse Source

fix windows build

Julius Pfrommer 10 years ago
parent
commit
34eb17c9c0
4 changed files with 5 additions and 6 deletions
  1. 2 2
      CMakeLists.txt
  2. 0 3
      examples/server.c
  3. 1 1
      include/ua_types.h
  4. 2 0
      src/server/ua_server_worker.c

+ 2 - 2
CMakeLists.txt

@@ -88,8 +88,8 @@ add_library(open62541-objects OBJECT ${lib_sources})
 add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-objects>)
 add_library(open62541-static STATIC $<TARGET_OBJECTS:open62541-objects>)
 SET_TARGET_PROPERTIES(open62541-static PROPERTIES OUTPUT_NAME open62541 CLEAN_DIRECT_OUTPUT 1) # static version that exports all symbols
-target_compile_definitions(open62541-objects PUBLIC UA_DYNAMIC_LINKING)
-target_compile_definitions(open62541-static PUBLIC UA_DYNAMIC_LINKING)
+target_compile_definitions(open62541-objects PRIVATE UA_DYNAMIC_LINKING)
+target_compile_definitions(open62541-static PRIVATE UA_DYNAMIC_LINKING)
 
 ## logging
 set(UA_LOGLEVEL 400 CACHE STRING "Level at which logs shall be reported")

+ 0 - 3
examples/server.c

@@ -74,9 +74,6 @@ int main(int argc, char** argv) {
     UA_Server_addVariableNode(server, myIntegerVariant, &UA_NODEID_NULL, &myIntegerName,
                               &UA_NODEID_STATIC(0, UA_NS0ID_OBJECTSFOLDER),
                               &UA_NODEID_STATIC(0, UA_NS0ID_ORGANIZES));
-
-    // add node with a callback to the userspace
-    
     
 #ifdef BENCHMARK
     UA_UInt32 nodeCount = 500;

+ 1 - 1
include/ua_types.h

@@ -402,7 +402,7 @@ UA_Boolean UA_EXPORT UA_ExpandedNodeId_isNull(const UA_ExpandedNodeId *p);
 #define UA_EXPANDEDNODEID_STATIC(NAMESPACE, NUMERICID) (UA_ExpandedNodeId) {             \
         .nodeId = {.namespaceIndex = NAMESPACE, .identifierType = UA_NODEIDTYPE_NUMERIC, \
                    .identifier.numeric = NUMERICID },                                    \
-        .serverIndex = 0, .namespaceUri = UA_STRING_NULL }
+        .serverIndex = 0, .namespaceUri = {.data = (UA_Byte*)0, .length = -1} }
     
 /* QualifiedName */
 UA_StatusCode UA_EXPORT UA_QualifiedName_copycstring(char const *src, UA_QualifiedName *dst);

+ 2 - 0
src/server/ua_server_worker.c

@@ -2,7 +2,9 @@
 #define __USE_POSIX
 #define _XOPEN_SOURCE 500
 #define __USE_POSIX199309
+#ifndef WIN32
 #include <sys/time.h>
+#endif
 #include <time.h>
 #include "ua_server_internal.h"