SDL: gendynapi.py: Fix output line ending when running in non-cygwin Windows.

From 84c69d0f9fc1b7893d5e32cfa9387e7c00913728 Mon Sep 17 00:00:00 2001
From: Miku AuahDark <[EMAIL REDACTED]>
Date: Sat, 4 May 2024 22:32:50 +0800
Subject: [PATCH] gendynapi.py: Fix output line ending when running in
 non-cygwin Windows.

---
 src/dynapi/gendynapi.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/dynapi/gendynapi.py b/src/dynapi/gendynapi.py
index 50de69d9c03b6..f084cd5b9cb37 100755
--- a/src/dynapi/gendynapi.py
+++ b/src/dynapi/gendynapi.py
@@ -342,7 +342,7 @@ def main():
 def full_API_json():
     if args.dump:
         filename = 'sdl.json'
-        with open(filename, 'w') as f:
+        with open(filename, 'w', newline='') as f:
             json.dump(full_API, f, indent=4, sort_keys=True)
             print("dump API to '%s'" % filename);
 
@@ -470,7 +470,7 @@ def add_dyn_api(proc):
     #
     # Add at last
     # SDL_DYNAPI_PROC(SDL_EGLConfig,SDL_EGL_GetCurrentEGLConfig,(void),(),return)
-    f = open(SDL_DYNAPI_PROCS_H, "a")
+    f = open(SDL_DYNAPI_PROCS_H, "a", newline="")
     dyn_proc = "SDL_DYNAPI_PROC(" + func_ret + "," + func_name + ",("
 
     i = ord('a')
@@ -532,7 +532,7 @@ def add_dyn_api(proc):
     #
     # Add at last
     # "#define SDL_DelayNS SDL_DelayNS_REAL
-    f = open(SDL_DYNAPI_OVERRIDES_H, "a")
+    f = open(SDL_DYNAPI_OVERRIDES_H, "a", newline="")
     f.write("#define " + func_name + " " + func_name + "_REAL\n")
     f.close()
 
@@ -546,7 +546,7 @@ def add_dyn_api(proc):
             new_input.append("    " + func_name + ";\n")
         new_input.append(line)
     input.close()
-    f = open(SDL_DYNAPI_SYM, 'w')
+    f = open(SDL_DYNAPI_SYM, 'w', newline='')
     for line in new_input:
         f.write(line)
     f.close()