Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
Signed-off-by: Ric Li <[email protected]>
  • Loading branch information
ricmli committed Nov 16, 2023
1 parent cb619d5 commit 6bb714a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
31 changes: 30 additions & 1 deletion lib/src/mt_instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

#include "mt_instance.h"

#ifndef WINDOWSENV

#include <sys/un.h>

#include "../manager/mtl_mproto.h"
#include "mt_log.h"

int mt_instance_put_lcore(struct mtl_main_impl* impl, unsigned int lcore_id) {
Expand Down Expand Up @@ -120,4 +123,30 @@ int mt_instance_uinit(struct mtl_main_impl* impl) {
if (sock <= 0) return -EIO;

return close(sock);
}
}

#else /* not supported on Windows */

int mt_instance_init(struct mtl_main_impl* impl) {
impl->instance_fd = -1;
return -ENOTSUP;
}

int mt_instance_uinit(struct mtl_main_impl* impl) {
MTL_MAY_UNUSED(impl);
return -ENOTSUP;
}

int mt_instance_get_lcore(struct mtl_main_impl* impl, unsigned int lcore_id) {
MTL_MAY_UNUSED(impl);
MTL_MAY_UNUSED(lcore_id);
return -ENOTSUP;
}

int mt_instance_put_lcore(struct mtl_main_impl* impl, unsigned int lcore_id) {
MTL_MAY_UNUSED(impl);
MTL_MAY_UNUSED(lcore_id);
return -ENOTSUP;
}

#endif
1 change: 0 additions & 1 deletion lib/src/mt_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <sys/queue.h>
#include <unistd.h>

#include "../manager/mtl_mproto.h"
#include "mt_mem.h"
#include "mt_platform.h"
#include "mt_quirk.h"
Expand Down

0 comments on commit 6bb714a

Please sign in to comment.