#include "vk_default_loader.h"
#include "vulkan/vulkan.h"

#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
    #include <dlfcn.h>
    static void* (*symLoader)(void* lib, const char* procname);
    static void* loaderWrap(VkInstance instance, const char* vkproc) {
        return (*symLoader)(instance, vkproc);
    }
#elif defined(__APPLE__) && defined(__MACH__)
    // #include <GLFW/glfw3.h>
    // static void* loaderWrap(VkInstance instance, const char* vkproc) {
    //     return glfwGetInstanceProcAddress(instance, vkproc);
    // }
#endif

void* getDefaultProcAddr() {
    #if defined(_WIN32)
        // TODO: WIN32 Vulkan loader
        return NULL;
    #elif defined(__APPLE__) && defined(__MACH__)
        // return &loaderWrap;
        return NULL;
    #elif defined(unix) || defined(__unix__) || defined(__unix)
        void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
        if (libvulkan == NULL) {
            return NULL;
        }
        symLoader = dlsym(libvulkan, "vkGetInstanceProcAddr");
        if (symLoader == NULL) {
            return NULL;
        }
        return &loaderWrap;
    #else
        // Unknown operating system
        return NULL;
    #endif
}

#include "vk_default_loader.h"
#include "vulkan/vulkan.h"

#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
#include <dlfcn.h>
static void* (*loadSym)(void* lib, const char* procname);
static void* loadSymWrap(VkInstance instance, const char* vkproc) {
	return (*loadSym)(instance, vkproc);
}
#endif

void* getDefaultProcAddr() {
    #if defined(_WIN32)
    // TODO: WIN32 Vulkan loader
    #elif defined(__APPLE__) && defined(__MACH__)
	// TODO: Darwin Vulkan loader (via MoltenVK)
    #elif defined(unix) || defined(__unix__) || defined(__unix)
	void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
    if (libvulkan == NULL) {
        return NULL;
    }

	loadSym = dlsym(libvulkan, "vkGetInstanceProcAddr");
	if (loadSym == NULL) {
		return NULL;
	}

	return &loadSymWrap;
    #else
    // Unknown operating system
    #endif
}
--- 
+++ 
@@ -3,31 +3,37 @@
 
 #if defined(_WIN32)
 #elif defined(unix) || defined(__unix__) || defined(__unix)
-#include <dlfcn.h>
-static void* (*loadSym)(void* lib, const char* procname);
-static void* loadSymWrap(VkInstance instance, const char* vkproc) {
-	return (*loadSym)(instance, vkproc);
-}
+    #include <dlfcn.h>
+    static void* (*symLoader)(void* lib, const char* procname);
+    static void* loaderWrap(VkInstance instance, const char* vkproc) {
+        return (*symLoader)(instance, vkproc);
+    }
+#elif defined(__APPLE__) && defined(__MACH__)
+    // #include <GLFW/glfw3.h>
+    // static void* loaderWrap(VkInstance instance, const char* vkproc) {
+    //     return glfwGetInstanceProcAddress(instance, vkproc);
+    // }
 #endif
 
 void* getDefaultProcAddr() {
     #if defined(_WIN32)
-    // TODO: WIN32 Vulkan loader
+        // TODO: WIN32 Vulkan loader
+        return NULL;
     #elif defined(__APPLE__) && defined(__MACH__)
-	// TODO: Darwin Vulkan loader (via MoltenVK)
+        // return &loaderWrap;
+        return NULL;
     #elif defined(unix) || defined(__unix__) || defined(__unix)
-	void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
-    if (libvulkan == NULL) {
+        void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
+        if (libvulkan == NULL) {
+            return NULL;
+        }
+        symLoader = dlsym(libvulkan, "vkGetInstanceProcAddr");
+        if (symLoader == NULL) {
+            return NULL;
+        }
+        return &loaderWrap;
+    #else
+        // Unknown operating system
         return NULL;
-    }
-
-	loadSym = dlsym(libvulkan, "vkGetInstanceProcAddr");
-	if (loadSym == NULL) {
-		return NULL;
-	}
-
-	return &loadSymWrap;
-    #else
-    // Unknown operating system
     #endif
 }
Fix no-return warning in loader, also change the internal variable names.
