Avoid usage of localized strings before initialization during import in many modules
This happens if import is done before i18n setup
(InstallLocalRessources()).
This affects PLCOpenEditor mostly. Beremiz IDE is free from this issue, but moving
initialization from import should make modules more robust.
Otherwise execution result depends on where and when import was done
and this is not a good thing.
Some modules (ConfigTreeNode, features, CodeFileEditor related
classes) still have this, but they are used only in Beremiz.
Most problems result in non-working internatialization.
In some cases (VariablePanel) there is backtrace, because localized
key is not found in non-localized dictionary.
/*
Template C code used to produce target Ethercat C code.
Copyright (C) 2011-2014: Laurent BESSARD, Edouard TISSERANT
Distributed under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
See COPYING file for copyrights details.
*/
#include "iec_types_all.h"
#define FREE 0
#define ACQUIRED 1
#define ANSWERED 2
long SDOLock = FREE;
extern long AtomicCompareExchange(long* atomicvar,long compared, long exchange);
int AcquireSDOLock() {
return AtomicCompareExchange(&SDOLock, FREE, ACQUIRED) == FREE;
}
void SDOAnswered() {
AtomicCompareExchange(&SDOLock, ACQUIRED, ANSWERED);
}
int HasAnswer() {
return SDOLock == ANSWERED;
}
void ReleaseSDOLock() {
AtomicCompareExchange(&SDOLock, ANSWERED, FREE);
}
int __init_etherlab_ext()
{
SDOLock = FREE;
return 0;
}
void __cleanup_etherlab_ext()
{
}
void __retrieve_etherlab_ext()
{
}
void __publish_etherlab_ext()
{
}