remove LogMessage prototype from plc_main_head.c
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 12 Jan 2019 13:57:16 +0300
changeset 2503 6ffeffb6d635
parent 2502 e582e8ddd0c8
child 2504 f3aced6c5f8b
remove LogMessage prototype from plc_main_head.c

it's not needed, because prototype is included in beremiz.h
But it caused problems with TARGET_LOGGING_DISABLE.
targets/beremiz.h
targets/plc_main_head.c
--- a/targets/beremiz.h	Mon Jan 07 23:28:28 2019 +0300
+++ b/targets/beremiz.h	Sat Jan 12 13:57:16 2019 +0300
@@ -11,7 +11,13 @@
 extern unsigned long long common_ticktime__;
 
 #ifdef TARGET_LOGGING_DISABLE
-#define LogMessage(level, buf, size)
+static inline int LogMessage(uint8_t level, char* buf, uint32_t size)
+{
+	(void)level;
+	(void)buf;
+	(void)size;
+	return 0;
+}
 #else
 int     LogMessage(uint8_t level, char* buf, uint32_t size);
 #endif
--- a/targets/plc_main_head.c	Mon Jan 07 23:28:28 2019 +0300
+++ b/targets/plc_main_head.c	Sat Jan 12 13:57:16 2019 +0300
@@ -35,9 +35,6 @@
 /* Help to quit cleanly when init fail at a certain level */
 static int init_level = 0;
 
-/* Prototype for Logging to help spotting errors at init */
-int LogMessage(uint8_t level, char* buf, uint32_t size);
-
 /*
  * Prototypes of functions exported by plugins
  **/