Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 d1x-rebirth (0.58.1-ok2) nile; urgency=medium
 .
   * Build for openKylin.
Author: openKylinBot <openKylinBot@openkylin.top>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2025-01-13

--- d1x-rebirth-0.58.1.orig/SConstruct
+++ d1x-rebirth-0.58.1/SConstruct
@@ -4,6 +4,7 @@
 import sys
 import os
 import SCons.Util
+from collections import deque
 
 class argumentIndirection:
 	def __init__(self,prefix):
@@ -348,7 +349,8 @@ class DXXProgram(DXXCommon):
 		objects = [self.env.StaticObject(target='%s%s%s' % (self.user_settings.builddir, os.path.splitext(s)[0], self.env["OBJSUFFIX"]), source=s) for s in self.common_sources]
 		objects.extend(self.platform_settings.platform_objects)
 		objects.extend(program_specific_objects)
-		versid_cppdefines=env['CPPDEFINES'][:]
+		cpp_defines = env.get('CPPDEFINES', deque())
+		versid_cppdefines = list(cpp_defines)
 		if self.user_settings.extra_version:
 			versid_cppdefines.append(('DESCENT_VERSION_EXTRA', '\\"%s\\"' % self.user_settings.extra_version))
 		objects.append(self.env.StaticObject(target='%s%s%s' % (self.user_settings.builddir, 'main/vers_id', self.env["OBJSUFFIX"]), source='main/vers_id.c', CPPDEFINES=versid_cppdefines))
