Changed runtime's global PLCID to PLC_ID, working around redefinition in windoze' headers.
authorEdouard Tisserant
Fri, 19 Jun 2015 09:34:18 +0200
changeset 1463 de311ffe3961
parent 1462 9ee3a2dea7e8
child 1467 68ba08b3a152
Changed runtime's global PLCID to PLC_ID, working around redefinition in windoze' headers.
runtime/PLCObject.py
targets/plc_main_head.c
tests/python/c_code@c_ext/cfile.xml
--- a/runtime/PLCObject.py	Thu Jun 18 15:22:43 2015 +0200
+++ b/runtime/PLCObject.py	Fri Jun 19 09:34:18 2015 +0200
@@ -142,9 +142,9 @@
             self._PLClibraryHandle = dlopen(self._GetLibFileName())
             self.PLClibraryHandle = ctypes.CDLL(self.CurrentPLCFilename, handle=self._PLClibraryHandle)
 
-            self.PLCID = ctypes.c_char_p.in_dll(self.PLClibraryHandle, "PLCID")
+            self.PLC_ID = ctypes.c_char_p.in_dll(self.PLClibraryHandle, "PLC_ID")
             if len(md5) == 32 : 
-                self.PLCID.value = md5 
+                self.PLC_ID.value = md5 
 
             self._startPLC = self.PLClibraryHandle.startPLC
             self._startPLC.restype = ctypes.c_int
--- a/targets/plc_main_head.c	Thu Jun 18 15:22:43 2015 +0200
+++ b/targets/plc_main_head.c	Fri Jun 19 09:34:18 2015 +0200
@@ -25,7 +25,7 @@
 IEC_TIME __CURRENT_TIME;
 IEC_BOOL __DEBUG = 0;
 unsigned long __tick = 0;
-char *PLCID = NULL;
+char *PLC_ID = NULL;
 
 /*
  *  Variable generated by C softPLC and plugins
--- a/tests/python/c_code@c_ext/cfile.xml	Thu Jun 18 15:22:43 2015 +0200
+++ b/tests/python/c_code@c_ext/cfile.xml	Fri Jun 19 09:34:18 2015 +0200
@@ -14,7 +14,7 @@
 volatile char PtoC=1,CtoP=2;
 
 extern long AtomicCompareExchange(long*,long, long);
-extern char *PLCID;
+extern char *PLC_ID;
 
 int Simple_C_Call(int val){
   return val+1;
@@ -35,7 +35,7 @@
     res=1;
   }
   printf("C code called by Python: toC %d fromC %d\n",toC,*fromC);
-  printf("PLCID id %s\n",PLCID);
+  printf("PLC_ID id %s\n",PLC_ID);
   return res;
 }