Skip to content

Commit 2030534

Browse files
committed
fixing macOS issue
1 parent 712ac4b commit 2030534

File tree

12 files changed

+12
-644
lines changed

12 files changed

+12
-644
lines changed

runtime/Includes/Core/Application.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ namespace mlx
4444
private:
4545
struct Hook
4646
{
47-
func::function<void(void*)> fn;
47+
std::function<void(void*)> fn;
4848
void* param;
4949

50-
Hook(func::function<void(void*)> fn, void* param) : fn(fn), param(param) {}
50+
Hook(std::function<void(void*)> fn, void* param) : fn(fn), param(param) {}
5151
};
5252

5353
private:

runtime/Includes/Core/EventListener.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ namespace mlx
99
{
1010
public:
1111
EventListener() = delete;
12-
EventListener(func::function<void(const EventBase&)> functor, std::string name);
12+
EventListener(std::function<void(const EventBase&)> functor, std::string name);
1313

1414
inline const std::string& GetName() const { return m_name; }
1515
inline void Call(const EventBase& event) const noexcept { m_listen_functor(event); }
1616

1717
~EventListener() = default;
1818

1919
private:
20-
func::function<void(const EventBase&)> m_listen_functor;
20+
std::function<void(const EventBase&)> m_listen_functor;
2121
std::string m_name;
2222
};
2323
}

runtime/Includes/Core/SDLManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace mlx
1414
Handle CreateWindow(const mlx_window_create_info* info, std::int32_t& id, bool hidden);
1515
void DestroyWindow(Handle window) noexcept;
1616

17-
void InputsFetcher(func::function<void(mlx_event_type, int, int)> functor);
17+
void InputsFetcher(std::function<void(mlx_event_type, int, int)> functor);
1818

1919
VkSurfaceKHR CreateVulkanSurface(Handle window, VkInstance instance) const noexcept;
2020
std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept;

runtime/Includes/Platform/Inputs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ namespace mlx
1212
public:
1313
struct Hook
1414
{
15-
func::function<void(int, void*)> fn;
15+
std::function<void(int, void*)> fn;
1616
void* param = nullptr;
1717

18-
Hook(func::function<void(int, void*)> fn, void* param) : fn(fn), param(param) {}
18+
Hook(std::function<void(int, void*)> fn, void* param) : fn(fn), param(param) {}
1919
};
2020

2121
public:

runtime/Includes/PreCompiled.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <string_view>
2929
#include <chrono>
3030
#include <unordered_set>
31-
#include <function.h>
3231
#include <array>
3332
#include <cstdint>
3433
#include <cstring>

runtime/Sources/Core/Bridge.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include "mlx_extended.h"
21
#include <PreCompiled.h>
32

43
#include <Core/Application.h>

runtime/Sources/Core/EventListener.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace mlx
55
{
6-
EventListener::EventListener(func::function<void(const EventBase&)> functor, std::string name)
6+
EventListener::EventListener(std::function<void(const EventBase&)> functor, std::string name)
77
: m_listen_functor(std::move(functor)), m_name(std::move(name))
88
{}
99
}

runtime/Sources/Core/SDLManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ namespace mlx
216216
return y;
217217
}
218218

219-
void SDLManager::InputsFetcher(func::function<void(mlx_event_type, int, int)> functor)
219+
void SDLManager::InputsFetcher(std::function<void(mlx_event_type, int, int)> functor)
220220
{
221221
SDL_Event event;
222222
while(SDL_PollEvent(&event))

runtime/Sources/Renderer/RenderPasses/2DPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace mlx
4545
};
4646
p_fragment_shader = std::make_shared<Shader>(fragment_shader_code, ShaderType::Fragment, std::move(fragment_shader_layout));
4747

48-
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
48+
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
4949
{
5050
if(event.What() == Event::ResizeEventCode)
5151
m_pipeline.Destroy();

runtime/Sources/Renderer/RenderPasses/FinalPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace mlx
3131
};
3232
p_fragment_shader = std::make_shared<Shader>(fragment_shader_code, ShaderType::Fragment, std::move(fragment_shader_layout));
3333

34-
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
34+
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
3535
{
3636
if(event.What() == Event::ResizeEventCode)
3737
m_pipeline.Destroy();

runtime/Sources/Renderer/RenderPasses/Passes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace mlx
1111

1212
m_2Dpass.Init();
1313
m_final.Init();
14-
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
14+
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
1515
{
1616
if(event.What() == Event::ResizeEventCode)
1717
m_main_render_texture.Destroy();

0 commit comments

Comments
 (0)