Skip to content

Commit

Permalink
make it work on MS Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 10, 2024
1 parent fe83ee0 commit 1e9e6ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,8 @@ def do_add_DLLs(prefix="lib", *dll_names: str) -> None:
if client_ENABLED:
# svg pixbuf loader:
add_DLLs("rsvg", "croco")
# gio module and `xpra.net.libproxy`:
add_DLLs("proxy-1")

if client_ENABLED or server_ENABLED:
add_DLLs("qrencode")
Expand Down
8 changes: 7 additions & 1 deletion xpra/net/libproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@
A library for proxy configuration and autodetection.
"""

import os

from ctypes import POINTER, cast, c_void_p, c_char_p
import ctypes.util


def _load(name, *versions):
for ver in versions:
if os.name == "nt":
libname = f"lib{name}-{ver}"
else:
libname = f"lib{name}.so.{ver}"
try:
return ctypes.cdll.LoadLibrary(f'lib{name}.so.{ver}')
return ctypes.cdll.LoadLibrary(libname)
except Exception:
pass
name_ver = ctypes.util.find_library(name)
Expand Down

0 comments on commit 1e9e6ac

Please sign in to comment.