Bladeren bron

Linux: also try opening libcurl.so.4;

bjorn 1 jaar geleden
bovenliggende
commit
69906e40f5
2 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 1 1
      README.md
  2. 2 1
      http.c

+ 1 - 1
README.md

@@ -90,7 +90,7 @@ Implementation
 `lovr-http` uses system-provided HTTP libraries:
 `lovr-http` uses system-provided HTTP libraries:
 
 
 - Windows uses wininet.
 - Windows uses wininet.
-- Linux uses curl (must be installed, but most systems have it).
+- Linux uses curl (must install e.g. `libcurl4` package, but most systems have it).
 - Android uses Java's HttpURLConnection via JNI.
 - Android uses Java's HttpURLConnection via JNI.
 - macOS uses NSURLSession.
 - macOS uses NSURLSession.
 
 

+ 2 - 1
http.c

@@ -500,7 +500,8 @@ static struct {
 static void* library;
 static void* library;
 
 
 static void http_init(void) {
 static void http_init(void) {
-  library = dlopen("libcurl.so", RTLD_LAZY);
+  library = dlopen("libcurl.so.4", RTLD_LAZY);
+  if (!library) library = dlopen("libcurl.so", RTLD_LAZY);
 
 
   if (library) {
   if (library) {
     FN_FOREACH(FN_LOAD)
     FN_FOREACH(FN_LOAD)