| Line | |
|---|
| 1 | /* $Id: kKLlog.h,v 1.3 2002-03-31 19:01:04 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * log - C-style logging - kprintf.
|
|---|
| 4 | * Dual mode, RING0 and RING3.
|
|---|
| 5 | * Dual 16 and 32 bit.
|
|---|
| 6 | *
|
|---|
| 7 | * Define NOLOGGING to disable logging for the given sourcefile or the entire system.
|
|---|
| 8 | *
|
|---|
| 9 | * Copyright (c) 1998-2001 knut st. osmundsen
|
|---|
| 10 | *
|
|---|
| 11 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 12 | *
|
|---|
| 13 | */
|
|---|
| 14 |
|
|---|
| 15 | #ifndef _log_h_
|
|---|
| 16 | #define _log_h_
|
|---|
| 17 |
|
|---|
| 18 | #ifdef __cplusplus
|
|---|
| 19 | extern "C" {
|
|---|
| 20 | #endif
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | /*
|
|---|
| 24 | * output macros
|
|---|
| 25 | */
|
|---|
| 26 | #define dprintf kprintf
|
|---|
| 27 | #if defined(DEBUG) && !defined(NOLOGGING)
|
|---|
| 28 | #if 0
|
|---|
| 29 | #ifdef INCL_16
|
|---|
| 30 | /* 16-bit */
|
|---|
| 31 | #include <d16vprintf.h>
|
|---|
| 32 | #define kprintf(a) printf16 a
|
|---|
| 33 | #define printf this function is not used in 16-bit code! Use printf16!
|
|---|
| 34 | #else
|
|---|
| 35 | /* 32-bit */
|
|---|
| 36 | #include <stdarg.h>
|
|---|
| 37 | #include <kKLprintf.h>
|
|---|
| 38 | #ifdef __cplusplus
|
|---|
| 39 | #define kprintf(a) ::printf a
|
|---|
| 40 | #else
|
|---|
| 41 | #define kprintf(a) printf a
|
|---|
| 42 | #endif
|
|---|
| 43 | #endif
|
|---|
| 44 | #else
|
|---|
| 45 | #ifndef KLOG_MOD
|
|---|
| 46 | #define KLOG_MOD 0
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 | #ifdef INCL_16
|
|---|
| 50 | /* 16-bit */
|
|---|
| 51 | #include <d16vprintf.h>
|
|---|
| 52 | #define kprintf(a) printf16 a
|
|---|
| 53 | #define printf this function is not used in 16-bit code! Use printf16!
|
|---|
| 54 | #else
|
|---|
| 55 | /* 32-bit */
|
|---|
| 56 | #include <kKLstdarg.h>
|
|---|
| 57 | #ifdef __cplusplus
|
|---|
| 58 | #define kprintf(a) ::kLogv(KLOG_MOD, KLOGPOS_EXT, KLOG_TYPE_PRINTF, ::kLogFixPrintf a)
|
|---|
| 59 | #else
|
|---|
| 60 | #define kprintf(a) kLogv(KLOG_MOD, KLOGPOS_EXT, KLOG_TYPE_PRINTF, kLogFixPrintf a)
|
|---|
| 61 | #endif
|
|---|
| 62 | #endif
|
|---|
| 63 | #endif
|
|---|
| 64 | #else
|
|---|
| 65 | #define kprintf(a) ((void)0)
|
|---|
| 66 | #endif
|
|---|
| 67 |
|
|---|
| 68 | #ifdef __cplusplus
|
|---|
| 69 | }
|
|---|
| 70 | #endif
|
|---|
| 71 | #endif
|
|---|
| 72 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.