wrapping stuff in DEBUG_ONLY
[libfirm] / ir / lpp / lpp_comm.c
index 63d344c..0a78591 100644 (file)
@@ -1,13 +1,29 @@
-/**
- * @file   lpp_comm.c
- * @date   21.07.2005
- * @author Sebastian Hack
+/*
+ * Copyright (C) 2005-2011 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
  *
- * Protocol stuff for lpp server
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
  *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief   Protocol stuff for lpp server
+ * @author  Sebastian Hack
  */
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 #include <arpa/inet.h>
 #endif
 
-#include "config.h"
-
 #include "irtools.h"
 #include "debug.h"
 
 #include "lpp_comm.h"
 
-/* undef to disable debugging */
-#undef  ENABLE_DEBUGGING
-
 struct _lpp_comm_t {
        int fd;
        size_t buf_size;
@@ -44,6 +55,7 @@ struct _lpp_comm_t {
        char *r_buf;
 };
 
+DEBUG_ONLY(
 static inline firm_dbg_module_t *get_dbg_module(void)
 {
        static firm_dbg_module_t *dbg = NULL;
@@ -55,6 +67,7 @@ static inline firm_dbg_module_t *get_dbg_module(void)
 }
 
 #define dbg get_dbg_module()
+)
 
 /**
  * Try to read some bytes but block until a certain amount is read.