New debug scheme with explicit debug channels declaration.
diff --git a/loader/dos/dosvm.c b/loader/dos/dosvm.c
index 3e79361..31cb259 100644
--- a/loader/dos/dosvm.c
+++ b/loader/dos/dosvm.c
@@ -32,6 +32,10 @@
#include "dosmod.h"
#include "debug.h"
+DECLARE_DEBUG_CHANNEL(int)
+DECLARE_DEBUG_CHANNEL(module)
+DECLARE_DEBUG_CHANNEL(relay)
+
#ifdef MZ_SUPPORTED
#include <sys/mman.h>
diff --git a/loader/dos/module.c b/loader/dos/module.c
index 2ac543c..64aea5d 100644
--- a/loader/dos/module.c
+++ b/loader/dos/module.c
@@ -34,6 +34,8 @@
#include "options.h"
#include "server.h"
+DEFAULT_DEBUG_CHANNEL(module)
+
#ifdef MZ_SUPPORTED
#include <sys/mman.h>
diff --git a/loader/elf.c b/loader/elf.c
index be7369e..50dfae6 100644
--- a/loader/elf.c
+++ b/loader/elf.c
@@ -26,6 +26,8 @@
#include "debug.h"
#include "winerror.h"
+DEFAULT_DEBUG_CHANNEL(win32)
+
WINE_MODREF *ELF_CreateDummyModule( LPCSTR libname, LPCSTR modname )
{
PIMAGE_DOS_HEADER dh;
diff --git a/loader/elfdll.c b/loader/elfdll.c
index 62b0eac..7d45fc3 100644
--- a/loader/elfdll.c
+++ b/loader/elfdll.c
@@ -19,6 +19,9 @@
#include "debug.h"
#include "winerror.h"
+DECLARE_DEBUG_CHANNEL(elfdll)
+DECLARE_DEBUG_CHANNEL(win32)
+
#if defined(HAVE_LIBDL) && defined(HAVE_DLFCN_H)
#include <dlfcn.h>
diff --git a/loader/libres.c b/loader/libres.c
index d2ed8a1..79b4cbb 100644
--- a/loader/libres.c
+++ b/loader/libres.c
@@ -12,6 +12,8 @@
#include "heap.h"
#include "xmalloc.h"
+DEFAULT_DEBUG_CHANNEL(resource)
+
typedef struct RLE
{
const wrc_resource32_t * const * Resources; /* NULL-terminated array of pointers */
diff --git a/loader/loadorder.c b/loader/loadorder.c
index 31c55ab..365befc 100644
--- a/loader/loadorder.c
+++ b/loader/loadorder.c
@@ -15,6 +15,8 @@
#include "heap.h"
#include "options.h"
+DEFAULT_DEBUG_CHANNEL(module)
+
/* #define DEBUG_LOADORDER */
diff --git a/loader/main.c b/loader/main.c
index e7b34ba..17def50 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -48,6 +48,8 @@
#include "cursoricon.h"
#include "loadorder.h"
+DEFAULT_DEBUG_CHANNEL(server)
+
int __winelib = 1; /* Winelib run-time flag */
/***********************************************************************
diff --git a/loader/module.c b/loader/module.c
index 30e5bdc..f9de51c 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -32,6 +32,9 @@
#include "loadorder.h"
#include "elfdll.h"
+DECLARE_DEBUG_CHANNEL(module)
+DECLARE_DEBUG_CHANNEL(win32)
+
/*************************************************************************
* MODULE32_LookupHMODULE
diff --git a/loader/ne/convert.c b/loader/ne/convert.c
index 8091ff9..a97af8e 100644
--- a/loader/ne/convert.c
+++ b/loader/ne/convert.c
@@ -10,6 +10,8 @@
#include "debug.h"
#include "debugtools.h"
+DEFAULT_DEBUG_CHANNEL(resource)
+
/**********************************************************************
* ConvertDialog32To16 (KERNEL.615)
*/
diff --git a/loader/ne/module.c b/loader/ne/module.c
index ae88eb0..d8b90ae 100644
--- a/loader/ne/module.c
+++ b/loader/ne/module.c
@@ -30,6 +30,8 @@
#include "loadorder.h"
#include "elfdll.h"
+DEFAULT_DEBUG_CHANNEL(module)
+
FARPROC16 (*fnSNOOP16_GetProcAddress16)(HMODULE16,DWORD,FARPROC16) = NULL;
void (*fnSNOOP16_RegisterDLL)(NE_MODULE*,LPCSTR) = NULL;
diff --git a/loader/ne/resource.c b/loader/ne/resource.c
index ddf33ee..6bd6215 100644
--- a/loader/ne/resource.c
+++ b/loader/ne/resource.c
@@ -23,6 +23,8 @@
#include "callback.h"
#include "debug.h"
+DEFAULT_DEBUG_CHANNEL(resource)
+
#define NEXT_TYPEINFO(pTypeInfo) ((NE_TYPEINFO *)((char*)((pTypeInfo) + 1) + \
(pTypeInfo)->count * sizeof(NE_NAMEINFO)))
diff --git a/loader/ne/segment.c b/loader/ne/segment.c
index 48585cc..5ba6484 100644
--- a/loader/ne/segment.c
+++ b/loader/ne/segment.c
@@ -28,6 +28,11 @@
#include "debug.h"
#include "xmalloc.h"
+DECLARE_DEBUG_CHANNEL(dll)
+DECLARE_DEBUG_CHANNEL(fixup)
+DECLARE_DEBUG_CHANNEL(module)
+DECLARE_DEBUG_CHANNEL(segment)
+
#define SEL(x) GlobalHandleToSel16(x)
/***********************************************************************
diff --git a/loader/pe_image.c b/loader/pe_image.c
index 4b71368..031d80d 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -58,6 +58,13 @@
#include "snoop.h"
#include "debug.h"
+DECLARE_DEBUG_CHANNEL(delayhlp)
+DECLARE_DEBUG_CHANNEL(fixup)
+DECLARE_DEBUG_CHANNEL(module)
+DECLARE_DEBUG_CHANNEL(relay)
+DECLARE_DEBUG_CHANNEL(segment)
+DECLARE_DEBUG_CHANNEL(win32)
+
/* convert PE image VirtualAddress to Real Address */
#define RVA(x) ((unsigned int)load_addr+(unsigned int)(x))
diff --git a/loader/resource.c b/loader/resource.c
index 1e4b998..7c5811f 100644
--- a/loader/resource.c
+++ b/loader/resource.c
@@ -32,6 +32,9 @@
#include "winerror.h"
#include "debugstr.h"
+DECLARE_DEBUG_CHANNEL(accel)
+DECLARE_DEBUG_CHANNEL(resource)
+
extern WORD WINE_LanguageId;
#define HRSRC_MAP_BLOCKSIZE 16
diff --git a/loader/task.c b/loader/task.c
index 75dd7bf..97f2ab5 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -38,6 +38,10 @@
#include "dde_proc.h"
#include "server.h"
+DECLARE_DEBUG_CHANNEL(relay)
+DECLARE_DEBUG_CHANNEL(task)
+DECLARE_DEBUG_CHANNEL(toolhelp)
+
/* Min. number of thunks allocated when creating a new segment */
#define MIN_THUNKS 32