targets/Win32/plc_Win32_main.c
changeset 568 20a223828a06
parent 521 02cb9e5fb6f6
child 580 9dd978e6537c
equal deleted inserted replaced
567:72b51ec5be64 568:20a223828a06
     4 
     4 
     5 #include <stdio.h>
     5 #include <stdio.h>
     6 #include <sys/timeb.h>
     6 #include <sys/timeb.h>
     7 #include <time.h>
     7 #include <time.h>
     8 #include <windows.h>
     8 #include <windows.h>
       
     9 #include <locale.h>
     9 
    10 
    10 /* provided by POUS.C */
    11 /* provided by POUS.C */
    11 extern unsigned long long common_ticktime__;
    12 extern unsigned long long common_ticktime__;
    12 
    13 
    13 long AtomicCompareExchange(long* atomicvar, long compared, long exchange)
    14 long AtomicCompareExchange(long* atomicvar, long compared, long exchange)
    60 
    61 
    61 #define maxval(a,b) ((a>b)?a:b)
    62 #define maxval(a,b) ((a>b)?a:b)
    62 int startPLC(int argc,char **argv)
    63 int startPLC(int argc,char **argv)
    63 {
    64 {
    64 	unsigned long thread_id = 0;
    65 	unsigned long thread_id = 0;
       
    66     setlocale(LC_NUMERIC, "C");
    65 	/* Define Ttick to 1ms if common_ticktime not defined */
    67 	/* Define Ttick to 1ms if common_ticktime not defined */
    66     Ttick = common_ticktime__?common_ticktime__:1000000;
    68     Ttick = common_ticktime__?common_ticktime__:1000000;
    67 
    69 
    68     debug_sem = CreateSemaphore(
    70     debug_sem = CreateSemaphore(
    69                             NULL,           // default security attributes
    71                             NULL,           // default security attributes