Prechádzať zdrojové kódy

Kernel: Overload dbgputstr for char array literals in C++

This just seems like something we should be able to do. The compiler
knows how long my "string literal" is, passing it along manually seems
siilly.
Andrew Kaster 5 rokov pred
rodič
commit
fe0eb04a22
1 zmenil súbory, kde vykonal 10 pridanie a 0 odobranie
  1. 10 0
      Kernel/kstdio.h

+ 10 - 0
Kernel/kstdio.h

@@ -18,3 +18,13 @@ int get_serial_debug();
 #ifndef __serenity__
 #define dbgprintf printf
 #endif
+
+#ifdef __cplusplus
+
+template <size_t N>
+inline int dbgputstr(const char (&array)[N])
+{
+    return ::dbgputstr(array, N);
+}
+
+#endif