浏览代码

Vulkan-Loader: Mark secure_getenv as available on Linux

It's a GNU extension part of glibc since 2.17, and it was also added
recently to musl libc. It doesn't seem to be available on *BSD (but
also not used there by Vulkan-Loader).

Could be made more thorough by doing a test compilation of a file to
check for the existence of the function on the host system, but unless
we run into actual issues, that's likely overkill.
Rémi Verschelde 5 年之前
父节点
当前提交
79a7be6e7d
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/vulkan/SCsub

+ 4 - 0
drivers/vulkan/SCsub

@@ -57,6 +57,10 @@ if env['builtin_vulkan']:
             'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
             'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
         ])
+        import platform
+        if (platform.system() == "Linux"):
+            # In glibc since 2.17 and musl libc since 1.1.24. Used by loader.c.
+            env_thirdparty.AppendUnique(CPPDEFINES=['HAVE_SECURE_GETENV'])
 
     loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources]
     env_thirdparty.add_source_files(env.drivers_sources, loader_sources)