Commit d1d3a034 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Get rid of -DDEBUG, and kill off the exported ERROR/TRACE defs. Move

them into a private header file.
parent e49fb6eb
......@@ -9,7 +9,8 @@ all: libevent.a
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -O -g -static -I. -Wall -DDEBUG
#CFLAGS += -DDEBUG
CFLAGS += -O -g -static -I. -Wall -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS += `elvin-config --cflags vin4mt`
OBJS = event.o util.o
......
......@@ -13,8 +13,14 @@
#include <string.h>
#include <unistd.h>
#include "event.h"
#undef TRACE
#include "log.h"
#define ERROR(fmt,...) error(__FUNCTION__ ": " fmt, ## __VA_ARGS__)
#ifdef DEBUG
#define TRACE(fmt,...) info(__FUNCTION__ ": " fmt, ## __VA_ARGS__)
#else
#define TRACE(fmt,...)
#endif
static char hostname[MAXHOSTNAMELEN];
......
......@@ -5,7 +5,7 @@
*
* @COPYRIGHT@
*
* $Id: event.h,v 1.9 2002-02-28 00:16:18 mike Exp $
* $Id: event.h,v 1.10 2002-03-05 16:33:41 stoller Exp $
*/
#ifndef __EVENT_H__
......@@ -108,19 +108,6 @@ typedef void (*event_notify_callback_t)(event_handle_t handle,
event_notification_t notification,
void *data);
/*
* Debugging and tracing definitions:
*/
#define ERROR(fmt,...) fprintf(stderr, __FUNCTION__ ": " fmt, ## __VA_ARGS__)
#ifdef DEBUG
#define TRACE(fmt,...) printf(__FUNCTION__ ": " fmt, ## __VA_ARGS__)
#define DBG(fmt,...) printf(fmt, ## __VA_ARGS__)
#else
#define TRACE(fmt,...)
#define DBG(fmt,...)
#endif /* DEBUG */
/*
* Function prototypes:
*/
......
......@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "event.h"
#include "log.h"
/* Attempt to allocate SIZE bytes of memory and exit if memory
allocation fails. Returns pointer to allocated memory. */
......@@ -18,8 +19,7 @@ xmalloc(int size)
void *p;
p = malloc(size);
if (!p) {
fprintf(stderr, "virtual memory exhausted\n");
exit(1);
fatal("virtual memory exhausted!");
}
return p;
}
......@@ -33,8 +33,7 @@ xrealloc(void *p, int size)
void *q;
q = realloc(p, size);
if (!q) {
fprintf(stderr, "virtual memory exhausted\n");
exit(1);
fatal("virtual memory exhausted!");
}
return q;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment