--- cpp/stdlib.cc	2024-12-28 01:12:35.000000000 +0800
+++ cpp/stdlib.cc	2025-05-08 12:53:10.000000000 +0800
@@ -6,7 +6,7 @@
 #include <dirent.h>  // closedir(), opendir(), readdir()
 #include <errno.h>
 #include <fcntl.h>      // open
-#include <math.h>       // isinf, isnan
+#include <cmath>        // isinf, isnan
 #include <signal.h>     // kill
 #include <sys/stat.h>   // umask
 #include <sys/types.h>  // umask
@@ -14,6 +14,9 @@
 #include <time.h>
 #include <unistd.h>
 
+using std::isinf;
+using std::isnan;
+
 #include "mycpp/runtime.h"
 // To avoid circular dependency with e_die()
 #include "prebuilt/core/error.mycpp.h"

--- mycpp/gc_mops.cc	2024-12-28 01:12:35.000000000 +0800
+++ mycpp/gc_mops.cc	2025-05-08 13:14:41.000000000 +0800
@@ -1,10 +1,16 @@
 #include "mycpp/gc_mops.h"
 
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
 #include <errno.h>
-#include <inttypes.h>  // PRIo64, PRIx64
-#include <math.h>      // isnan(), isinf()
+#include <cinttypes>  // PRIo64, PRIx64
+#include <cmath>      // isnan(), isinf()
 #include <stdio.h>
 
+using std::isinf;
+using std::isnan;
+
 #include "mycpp/gc_alloc.h"
 #include "mycpp/gc_builtins.h"  // StringToInt64
 #include "mycpp/gc_str.h"

--- mycpp/mark_sweep_heap.cc	2024-12-28 01:12:35.000000000 +0800
+++ mycpp/mark_sweep_heap.cc	2025-05-08 13:15:37.000000000 +0800
@@ -1,6 +1,9 @@
 #include "mycpp/mark_sweep_heap.h"
 
-#include <inttypes.h>  // PRId64
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+#include <cinttypes>   // PRId64
 #include <stdlib.h>    // getenv()
 #include <string.h>    // strlen()
 #include <sys/time.h>  // gettimeofday()
