All Runtimes: Now sizeof(tick)=4 on all platforms (unsigned int).
--- a/targets/Linux/plc_Linux_main.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/Linux/plc_Linux_main.c Fri May 24 18:47:30 2024 +0200
@@ -25,7 +25,7 @@
#define _LogError(text,...) _Log(LOG_CRITICAL, text, ##__VA_ARGS__)
#define _LogWarning(text,...) _Log(LOG_WARNING, text, ##__VA_ARGS__)
-static unsigned long __debug_tick;
+static unsigned int __debug_tick; static pthread_t PLC_thread;
static pthread_mutex_t python_wait_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -305,9 +305,9 @@
-extern unsigned long __tick;
+extern unsigned int __tick; -int WaitDebugData(unsigned long *tick)
+int WaitDebugData(unsigned int *tick) if (PLC_shutdown) return 1;
--- a/targets/OSX/plc_OSX_main.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/OSX/plc_OSX_main.c Fri May 24 18:47:30 2024 +0200
@@ -69,7 +69,7 @@
-static unsigned long __debug_tick;
+static unsigned int __debug_tick; static pthread_mutex_t python_wait_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -165,9 +165,9 @@
-extern unsigned long __tick;
+extern unsigned int __tick; -int WaitDebugData(unsigned long *tick)
+int WaitDebugData(unsigned int *tick) --- a/targets/Win32/plc_Win32_main.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/Win32/plc_Win32_main.c Fri May 24 18:47:30 2024 +0200
@@ -146,7 +146,7 @@
-static unsigned long __debug_tick;
+static unsigned int __debug_tick; int TryEnterDebugSection(void)
@@ -187,7 +187,7 @@
/* from plc_debugger.c */
-int WaitDebugData(unsigned long *tick)
+int WaitDebugData(unsigned int *tick) res = WaitForSingleObject(debug_wait_sem, INFINITE);
--- a/targets/Xenomai/plc_Xenomai_main.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/Xenomai/plc_Xenomai_main.c Fri May 24 18:47:30 2024 +0200
@@ -336,9 +336,9 @@
-extern unsigned long __tick;
+extern unsigned int __tick; -int WaitDebugData(unsigned long *tick)
+int WaitDebugData(unsigned int *tick) --- a/targets/plc_debug.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/plc_debug.c Fri May 24 18:47:30 2024 +0200
@@ -170,7 +170,7 @@
extern void InitiateDebugTransfer(void);
extern void CleanupRetain(void);
-extern unsigned long __tick;
+extern unsigned int __tick; void __cleanup_debug(void)
@@ -490,7 +490,7 @@
-int WaitDebugData(unsigned long *tick);
+int WaitDebugData(unsigned int *tick); /* Wait until debug data ready and return pointer to it */
int GetDebugData(unsigned int *tick, unsigned int *size, void **buffer){
int wait_error = WaitDebugData(tick);
--- a/targets/plc_main_head.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/plc_main_head.c Fri May 24 18:47:30 2024 +0200
@@ -7,7 +7,7 @@
* Prototypes of functions provided by generated C softPLC
-void config_run__(unsigned long tick);
+void config_run__(unsigned int tick); void config_init__(void);
@@ -24,13 +24,13 @@
-unsigned long __tick = 0;
+unsigned int __tick = 0; * Variable generated by C softPLC and plugins
-extern unsigned long greatest_tick_count__;
+extern unsigned int greatest_tick_count__; /* Help to quit cleanly when init fail at a certain level */
static int init_level = 0;
--- a/targets/plc_main_tail.c Fri May 24 18:32:23 2024 +0200
+++ b/targets/plc_main_tail.c Fri May 24 18:47:30 2024 +0200
@@ -45,7 +45,7 @@
@@ -146,7 +146,7 @@
static long long Tsync = 0;
static long long FreqCorr = 0;
-static unsigned long last_tick = 0;
+static unsigned int last_tick = 0; * Called on each external periodic sync event