diff --git a/src/system/kernel/debug/Jamfile b/src/system/kernel/debug/Jamfile index c55bb7d7eb..f0922aacf9 100644 --- a/src/system/kernel/debug/Jamfile +++ b/src/system/kernel/debug/Jamfile @@ -4,7 +4,7 @@ UsePrivateHeaders [ FDirName kernel debug ] syslog_daemon ; KernelMergeObject kernel_debug.o : blue_screen.cpp - debug.c + debug.cpp frame_buffer_console.cpp gdb.c tracing.cpp diff --git a/src/system/kernel/debug/debug.c b/src/system/kernel/debug/debug.cpp similarity index 98% rename from src/system/kernel/debug/debug.c rename to src/system/kernel/debug/debug.cpp index e1ab5e41c5..353328fb97 100644 --- a/src/system/kernel/debug/debug.c +++ b/src/system/kernel/debug/debug.cpp @@ -503,14 +503,14 @@ syslog_sender(void *data) acquire_spinlock(&sSpinlock); length = ring_buffer_readable(sSyslogBuffer); - if (length > SYSLOG_MAX_MESSAGE_LENGTH) + if (length > (int32)SYSLOG_MAX_MESSAGE_LENGTH) length = SYSLOG_MAX_MESSAGE_LENGTH; length = ring_buffer_read(sSyslogBuffer, (uint8 *)sSyslogMessage->message, length); if (sSyslogDropped) { // add drop marker - if (length < SYSLOG_MAX_MESSAGE_LENGTH - 6) + if (length < (int32)SYSLOG_MAX_MESSAGE_LENGTH - 6) strlcat(sSyslogMessage->message, "", SYSLOG_MAX_MESSAGE_LENGTH); else if (length > 7) strcpy(sSyslogMessage->message + length - 7, ""); @@ -558,7 +558,7 @@ syslog_write(const char *text, int32 length) if (sSyslogBuffer == NULL) return; - if (ring_buffer_writable(sSyslogBuffer) < length) { + if ((int32)ring_buffer_writable(sSyslogBuffer) < length) { // truncate data length = ring_buffer_writable(sSyslogBuffer); @@ -610,7 +610,7 @@ syslog_init(struct kernel_args *args) if (!sSyslogOutputEnabled) return B_OK; - sSyslogMessage = malloc(SYSLOG_MESSAGE_BUFFER_SIZE); + sSyslogMessage = (syslog_message*)malloc(SYSLOG_MESSAGE_BUFFER_SIZE); if (sSyslogMessage == NULL) { status = B_NO_MEMORY; goto err1; @@ -630,7 +630,7 @@ syslog_init(struct kernel_args *args) //strcpy(sSyslogMessage->ident, "KERNEL"); if (args->debug_output != NULL) - syslog_write(args->debug_output, args->debug_size); + syslog_write((const char*)args->debug_output, args->debug_size); return B_OK; diff --git a/src/system/kernel/debug/gdb.h b/src/system/kernel/debug/gdb.h index 66bfc8b572..4af7cf4ba6 100644 --- a/src/system/kernel/debug/gdb.h +++ b/src/system/kernel/debug/gdb.h @@ -5,6 +5,9 @@ #ifndef _KERNEL_GDB_H #define _KERNEL_GDB_H -extern int cmd_gdb(int, char **); +#ifdef __cplusplus +extern "C" +#endif +int cmd_gdb(int, char **); #endif