Skip to content

Commit

Permalink
move preview2.h to wasi directory
Browse files Browse the repository at this point in the history
Signed-off-by: Joel Dice <[email protected]>
  • Loading branch information
dicej committed Jan 11, 2024
1 parent 791608d commit 1ae7202
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ BULK_MEMORY_THRESHOLD ?= 32
# Set the default WASI target triple.
TARGET_TRIPLE = wasm32-wasi

# Threaded version necessitates a different traget, as objects from different
# Threaded version necessitates a different target, as objects from different
# targets can't be mixed together while linking.
ifeq ($(THREAD_MODEL), posix)
TARGET_TRIPLE = wasm32-wasi-threads
Expand Down Expand Up @@ -885,8 +885,13 @@ bindings: $(BINDING_WORK_DIR)/wasi-cli $(BINDING_WORK_DIR)/wit-bindgen
--rename wasi:cli/[email protected]=terminal_stdout \
--rename wasi:cli/[email protected]=terminal_stderr \
./wasi-cli/wit && \
mv preview2.h ../../libc-bottom-half/headers/public/ && \
mv preview2.c preview2_component_type.o ../../libc-bottom-half/sources
mv preview2.h ../../libc-bottom-half/headers/public/wasi/ && \
mv preview2_component_type.o ../../libc-bottom-half/sources && \
sed 's_#include "preview2.h"_#include "wasi/preview2.h"_' \
< preview2.c \
> ../../libc-bottom-half/sources/preview2.c && \
rm preview2.c


clean:
$(RM) -r "$(BINDING_WORK_DIR)"
Expand Down
2 changes: 1 addition & 1 deletion expected/wasm32-wasi-preview2/include-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
#include <netpacket/packet.h>
#include <nl_types.h>
#include <poll.h>
#include <preview2.h>
#include <regex.h>
#include <sched.h>
#include <search.h>
Expand Down Expand Up @@ -168,5 +167,6 @@
#include <wasi/libc-find-relpath.h>
#include <wasi/libc-nocwd.h>
#include <wasi/libc.h>
#include <wasi/preview2.h>
#include <wchar.h>
#include <wctype.h>
File renamed without changes.
2 changes: 1 addition & 1 deletion libc-bottom-half/sources/preview2.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by `wit-bindgen` 0.16.0. DO NOT EDIT!
#include "preview2.h"
#include "wasi/preview2.h"


__attribute__((__import_module__("wasi:cli/[email protected]"), __import_name__("get-environment")))
Expand Down

0 comments on commit 1ae7202

Please sign in to comment.