Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
No need to have difference between win32 and Unix system for log.
authorunknown <pierre@.(none)>
Thu, 28 Jul 2011 11:33:11 +0000 (13:33 +0200)
committerunknown <pierre@.(none)>
Thu, 28 Jul 2011 11:33:11 +0000 (13:33 +0200)
include/xbt/log.h
src/xbt/log.c

index 8ffe99f..d80ba1e 100644 (file)
 
 /* XBT_LOG_MAYDAY: define this to replace the logging facilities with basic
    printf function. Useful to debug the logging facilities themselves */
-#include "gras_config.h"
 #undef XBT_LOG_MAYDAY
 //#define XBT_LOG_MAYDAY
-#ifdef _WIN64
-       #define XBT_LOG_MAYDAY
-#endif
 
 #ifndef _XBT_LOG_H_
 #define _XBT_LOG_H_
@@ -245,11 +241,9 @@ typedef struct xbt_log_category_s s_xbt_log_category_t,
 /*
  * Do NOT access any members of this structure directly. FIXME: move to private?
  */
-#ifdef _XBT_WIN32
-#define XBT_LOG_BUFF_SIZE  16384        /* Size of the static string in which we build the log string */
-#else
+
 #define XBT_LOG_BUFF_SIZE 2048  /* Size of the static string in which we build the log string */
-#endif
+
 struct xbt_log_category_s {
   xbt_log_category_t parent;
   xbt_log_category_t firstChild;
@@ -270,11 +264,7 @@ struct xbt_log_event_s {
   int lineNum;
   va_list ap;
   va_list ap_copy;              /* need a copy to launch dynamic layouts when the static ones overflowed */
-#ifdef _XBT_WIN32
-  char *buffer;
-#else
   char buffer[XBT_LOG_BUFF_SIZE];
-#endif
 };
 
 /**
@@ -393,15 +383,10 @@ extern xbt_log_layout_t xbt_log_default_layout;
  * code. 
  * Setting the LogEvent's valist member is done inside _log_logEvent.
  */
-#ifdef _XBT_WIN32
-#include <stdlib.h>             /* calloc */
-#define _XBT_LOG_EV_BUFFER_ZERO() \
-  _log_ev.buffer = (char*) calloc(XBT_LOG_BUFF_SIZE + 1, sizeof(char))
-#else
+
 #include <string.h>             /* memset */
 #define _XBT_LOG_EV_BUFFER_ZERO() \
   memset(_log_ev.buffer, 0, XBT_LOG_BUFF_SIZE)
-#endif
 
 /* Logging Macros */
 
index e4030ef..6915419 100644 (file)
@@ -626,10 +626,6 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
   }
   va_end(ev->ap);
   va_end(ev->ap_copy);
-
-#ifdef _XBT_WIN32
-  free(ev->buffer);
-#endif
 }
 
 /* NOTE: