Julius Pfrommer 11 rokov pred
rodič
commit
66743dc81e

+ 2 - 0
examples/src/networklayer.c

@@ -139,7 +139,9 @@ void* NL_Connection_init(NL_connection* c, NL_data* tld, UA_Int32 connectionHand
 
 	// network layer
 	c->reader = reader;
+#ifdef MULTITHREADING
 	c->readerThreadHandle = -1;
+#endif
 	c->networkLayer = tld;
 	return UA_NULL;
 }

+ 4 - 0
examples/src/networklayer.h

@@ -36,7 +36,9 @@ typedef struct T_NL_data {
 	NL_Description* tld;
 	UA_String endpointUrl;
 	int listenerHandle;
+#ifdef MULTITHREADING
 	pthread_t listenerThreadHandle;
+#endif
 	UA_list_List connections;
 	fd_set readerHandles;
 	int maxReaderHandle;
@@ -47,7 +49,9 @@ typedef void* (*NL_reader)(struct T_NL_connection *c);
 typedef struct T_NL_connection {
 	TL_connection connection;
 	NL_reader reader;
+#ifdef MULTITHREADING
 	pthread_t readerThreadHandle;
+#endif
 	NL_data* networkLayer;
 } NL_connection;
 

+ 0 - 6
examples/src/opcuaServer.c

@@ -19,12 +19,6 @@ UA_Int32 serverCallback(void * arg) {
 	return UA_SUCCESS;
 }
 
-// necessary for the linker
-int pthread_create(pthread_t* newthread, const pthread_attr_t* attr, void *(*start) (void *), void * arg) {
-	perror("this routine should be never called in single-threaded mode\n");
-	exit(1);
-}
-
 int main(int argc, char** argv) {
 	NL_data* nl = NL_init(&NL_Description_TcpBinary,16664);
 	struct timeval tv = {2, 0}; // 2 seconds

+ 0 - 1
src/ua_application.h

@@ -3,7 +3,6 @@
 
 #include "opcua.h"
 #include "ua_namespace.h"
-#include "ua_statuscodes.h"
 #include "ua_indexedList.h"
 
 typedef struct UA_Application_T {

+ 0 - 1
src/ua_services.h

@@ -3,7 +3,6 @@
 
 #include "opcua.h"
 #include "ua_application.h"
-#include "ua_statuscodes.h"
 #include "ua_transport_binary_secure.h"
 
 /* Part 4: 5.4 Discovery Service Set */

+ 1 - 0
src/ua_services_attribute.c

@@ -1,4 +1,5 @@
 #include "ua_services.h"
+#include "ua_statuscodes.h"
 
 enum UA_AttributeId {
 	UA_ATTRIBUTEID_NODEID = 1,

+ 1 - 1
tests/check_builtin.c

@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "opcua.h"
-#include "ua_transportLayer.h"
+#include "ua_transport.h"
 #include "check.h"
 
 

+ 1 - 1
tests/check_stack.c

@@ -12,7 +12,7 @@
 #include <stdlib.h>
 
 #include "opcua.h"
-#include "ua_transportLayer.h"
+#include "ua_transport.h"
 #include "check.h"