diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f2b404 --- /dev/null +++ b/Makefile @@ -0,0 +1,200 @@ +# +# Configuration parts of GNU Make/GCC build system. +# Copyright (C) 2022 by KO Myung-Hun +# +# This file is part of GNU Make/GCC build system. +# +# This program is free software. It comes without any warranty, to +# the extent permitted by applicable law. You can redistribute it +# and/or modify it under the terms of the Do What The Fuck You Want +# To Public License, Version 2, as published by Sam Hocevar. See +# http://www.wtfpl.net/ for more details. +# + +##### Configuration parts that you can modify + +# specify sub directories +SUBDIRS := + +# specify gcc compiler flags for all the programs +CFLAGS := -Wall -DOS2EMX_PLAIN_CHAR -funsigned-char -O3 + +# specify g++ compiler flags for all the programs +CXXFLAGS := -Wall -DOS2EMX_PLAIN_CHAR -funsigned-char -O3 + +# specify linker flags such as -L option for all the programs +LDFLAGS := + +# specify dependent libraries such as -l option for all the programs +LDLIBS := + +ifdef RELEASE +# specify flags for release mode +CFLAGS += +CXXFLAGS += +LDFLAGS += +else +# specify flags for debug mode +CFLAGS += +CXXFLAGS += +LDFLAGS += +endif + +# specify resource compiler, default is rc if not set +RC := + +# specify resource compiler flags +RCFLAGS := + +# set if you want not to compress resources +NO_COMPRESS_RES := + +# specify BLDLEVEL VENDOR string +BLDLEVEL_VENDOR := OS/2 Factory + +# specify a macro defining version, and a file including that macro +# to generate BLDLEVEL version string +BLDLEVEL_VERSION_MACRO := +BLDLEVEL_VERSION_FILE := + +# specify BLDLEVEL VERSION string if you want to set VERSION string manually, +# default is generated with BLDLEVEL_VERSION_MACRO and BLDLEVEL_VERSION_FILE +# if unset +BLDLEVEL_VERSION := $(shell date +%y.%m.%d) + +# Variables for programs +# +# 1. specify a list of programs without an extension with +# +# BIN_PROGRAMS +# +# Now, assume +# +# BIN_PROGRAMS := program +# +# 2. specify sources for a specific program with +# +# program_SRCS +# +# the above is REQUIRED +# +# 3. specify various OPTIONAL flags for a specific program with +# +# program_CFLAGS for gcc compiler flags +# program_CXXFLAGS for g++ compiler flags +# program_LDFLAGS for linker flags +# program_LDLIBS for dependent libraries +# program_RCSRC for rc source +# program_RCFLAGS for rc flags +# program_DEF for .def file +# program_EXTRADEPS for extra dependencies +# program_DESC for a BLDLEVEL description string +# program_OUTDIR for the place where to store .EXE + +BIN_PROGRAMS := + +# Variables for libraries +# +# 1. specify a list of libraries without an extension with +# +# BIN_LIBRARIES +# +# Now, assume +# +# BIN_LIBRARIES := library +# +# 2. specify sources for a specific library with +# +# library_SRCS +# +# the above is REQUIRED +# +# 3. set library type flags for a specific library to a non-empty value +# +# library_LIB to create a static library +# library_DLL to build a DLL +# +# either of the above SHOULD be SET +# +# 4. specify various OPTIONAL flags for a specific library with +# +# library_CFLAGS for gcc compiler flags +# library_CXXFLAGS for g++ compiler flags +# +# the above is common for LIB and DLL +# +# library_DLLNAME for customized DLL name without an extension +# library_LDFLAGS for linker flags +# library_LDLIBS for dependent libraries +# library_RCSRC for rc source +# library_RCFLAGS for rc flags +# library_DEF for .def file, if not set all the symbols are exported +# library_NO_EXPORT if set, no symbols are exported in .def file +# library_EXTRADEPS for extra dependencies +# library_NO_IMPLIB if set, implib is not generated. +# library_DESC for a BLDLEVEL description string +# library_OUTDIR for the place where to store .DLL and so on +# +# the above is only for DLL + +BIN_LIBRARIES := os2compat + +os2compat_DIRS := io memory network process thread +os2compat_SRCS := $(foreach d,$(os2compat_DIRS),$(wildcard $(d)/*.c)) +os2compat_LIB := 1 +os2compat_DLL := 1 +os2compat_DLLNAME := os2comp0 +os2compat_DESC := Supplementary library for missing features in OS/2 kLIBC +os2compat_OUTDIR := lib + +include Makefile.common + +# additional stuffs + +PREFIX := /usr/local +LIBDIR := $(PREFIX)/lib +INCLUDEDIR := $(PREFIX)/include + +INSTALL := ginstall + +.PHONY: install install_libs install_headers + +install: all install_libs install_headers + +LIB_FILES := $(os2compat_OUTDIR)/$(os2compat_DLLNAME)$(DLL_EXT) \ + $(os2compat_OUTDIR)/os2compat$(LIB_EXT) \ + $(os2compat_OUTDIR)/os2compat$(OMF_LIB_EXT) \ + $(os2compat_OUTDIR)/os2compat_dll$(LIB_EXT) \ + $(os2compat_OUTDIR)/os2compat_dll$(OMF_LIB_EXT) + +install_libs: $(LIB_FILES) + $(INSTALL) -d $(DESTDIR)$(LIBDIR) + $(INSTALL) $(LIB_FILES) $(DESTDIR)$(LIBDIR) + +HEADER_FILES := include/os2compat/dirent.h \ + include/os2compat/netdb.h \ + include/os2compat/poll.h \ + include/os2compat/semaphore.h \ + include/os2compat/net/if.h \ + include/os2compat/sys/mman.h \ + include/os2compat/sys/socket.h \ + include/os2compat/sys/xpoll.h + +PRIV_HEADER_FILES := io/scandir.h \ + memory/mmap.h \ + network/cmsg.h \ + network/getaddrinfo.h \ + network/if_nameindex.h \ + network/poll.h \ + network/shutdown.h \ + network/socklen_t.h \ + network/xpoll.h \ + thread/semaphore.h + +install_headers: $(HEADER_FILES) $(PRIV_HEADER_FILES ) + for h in $(subst include/,,$(HEADER_FILES)); do \ + $(INSTALL) -D include/$$h $(DESTDIR)$(INCLUDEDIR)/$$h; \ + done + for h in $(PRIV_HEADER_FILES); do \ + $(INSTALL) -D $$h $(DESTDIR)$(INCLUDEDIR)/os2compat/priv/$$h; \ + done diff --git a/Makefile.common b/Makefile.common new file mode 100644 index 0000000..3c966c1 --- /dev/null +++ b/Makefile.common @@ -0,0 +1,299 @@ +# +# Common parts of GNU Make/GCC build system +# Copyright (C) 2022 by KO Myung-Hun +# +# This file is part of GNU Make/GCC build system. +# +# This program is free software. It comes without any warranty, to +# the extent permitted by applicable law. You can redistribute it +# and/or modify it under the terms of the Do What The Fuck You Want +# To Public License, Version 2, as published by Sam Hocevar. See +# http://www.wtfpl.net/ for more details. +# + +##### Common parts that you don't have to modify + +OBJ_EXT := .o +LIB_EXT := .a +OMF_LIB_EXT := .lib +EXE_EXT := .exe +DLL_EXT := .dll + +.SUFFIXES : .def .exe .dll .a .lib .o .obj .res .c .cpp .h .rc .d $(OBJ_EXT) $(LIB_EXT) $(OMF_LIB_EXT) $(EXE_EXT) $(DLL_EXT) + +# set compiler and linker +CC := gcc +CXX := g++ +LD := g++ + +# always build with -Zomf +LDFLAGS += -Zomf + +ifneq ($(filter wlink WLINK,$(EMXOMFLD_TYPE)),) +LDFLAGS += -Zlinker "DISABLE 1121" +endif + +ifdef RELEASE +# remove symbols +LDFLAGS += -s +# pack the executable and DLLs +LXLITE := lxlite /B- /L- /CS +else +# enable symbolic debugging +CFLAGS += -g +CXXFLAGS += -g +LDFLAGS += -g +# ignore packing +LXLITE := echo ignore packing +endif + +# set archiver +AR := ar + +# default resource compiler is rc +ifeq ($(strip $(RC)),) +RC := rc +endif + +# set mkdir -p +MKDIR_P := mkdir -p + +# BLDLEVEL string +BLDLEVEL_DATE := $(shell LANG=C date +"\" %F %T %^Z \"") +BLDLEVEL_HOST = $(shell echo $(HOSTNAME) | cut -b -11) + +ifeq ($(strip $(BLDLEVEL_VERSION)),) +ifneq ($(strip $(BLDLEVEL_VERSION_FILE)),) +BLDLEVEL_VERSION := $(shell sed -n -e "s/^[ \t]*\#[ \t]*define[ \t]\+$(BLDLEVEL_VERSION_MACRO)[ \t]\+\"\(.*\)\"/\1/p" $(BLDLEVEL_VERSION_FILE)) +endif +endif + +BLDLEVEL := @\#$(BLDLEVEL_VENDOR):$(BLDLEVEL_VERSION)\#@\#\#1\#\#$(BLDLEVEL_DATE)$(BLDLEVEL_HOST)::::::@@ + +# default verbose is quiet, that is V=0 +QUIET_ = @ +QUIET_0 = @ + +QUIET = $(QUIET_$(V)) + +# template to build the executable +define program_template +$(1)_DEPS := $(foreach s,$($(1)_SRCS),$(s:$(suffix $(s))=.d)) +$$($(1)_DEPS) : CFLAGS += $($(1)_CFLAGS) +$$($(1)_DEPS) : CXXFLAGS += $($(1)_CXXFLAGS) + +$(1)_OBJS := $$($(1)_DEPS:.d=$(OBJ_EXT)) +$$($(1)_OBJS) : CFLAGS += $($(1)_CFLAGS) +$$($(1)_OBJS) : CXXFLAGS += $($(1)_CXXFLAGS) + +$(1)_RES := $$($(1)_RCSRC:.rc=.res) + +$(1)_DESC := $(if $($(1)_DESC),$($(1)_DESC),$(1)) + +$(1)_OUTDIR := $(if $($(1)_OUTDIR),$($(1)_OUTDIR),.) + +# create a output directory +ifneq ($$($(1)_OUTDIR),.) +$$(shell $(MKDIR_P) $$($(1)_OUTDIR)) +endif + +$$($(1)_OUTDIR)/$(1)$(EXE_EXT) : $$($(1)_OBJS) $$($(1)_RES) $$($(1)_DEF) $$($(1)_EXTRADEPS) + $(if $(QUIET), @echo [LD] $$@) + $(QUIET)$(LD) $(LDFLAGS) $$($(1)_LDFLAGS) -o $$@ $$($(1)_OBJS) $$($(1)_DEF) $(LDLIBS) $$($(1)_LDLIBS) +ifneq ($$($(1)_RES),) +ifeq ($(strip $(NO_COMPRESS_RES)),) + $(if $(QUIET), @echo [BIND] $$($(1)_RES) to $$@) + $(QUIET)$(RC) $$($(1)_RES) $$@ +endif +endif + $(if $(QUIET), @echo [LXLITE] $$@) + $(QUIET)$(LXLITE) $$@ +ifneq ($$($(1)_RES),) +ifneq ($(strip $(NO_COMPRESS_RES)),) + $(if $(QUIET), @echo [BIND] $$($(1)_RES) to $$@) + $(QUIET)$(RC) $$($(1)_RES) $$@ +endif +endif + $(if $(QUIET), @echo [BLDLEVEL] $$@) + $(QUIET)echo $(BLDLEVEL)$$($(1)_DESC) >> $$@ + +$(1) : $$($(1)_OUTDIR)/$(1)$(EXE_EXT) +endef + +# template to create a static library +define lib_template +$(1)_DEPS := $(foreach s,$($(1)_SRCS),$(s:$(suffix $(s))=.d)) +$$($(1)_DEPS) : CFLAGS += $($(1)_CFLAGS) +$$($(1)_DEPS) : CXXFLAGS += $($(1)_CXXFLAGS) + +$(1)_OBJS := $$($(1)_DEPS:.d=$(OBJ_EXT)) +$$($(1)_OBJS) : CFLAGS += $($(1)_CFLAGS) +$$($(1)_OBJS) : CXXFLAGS += $($(1)_CXXFLAGS) + +$(1)_OUTDIR := $(if $($(1)_OUTDIR),$($(1)_OUTDIR),.) + +# create a output directory +ifneq ($$($(1)_OUTDIR),.) +$$(shell $(MKDIR_P) $$($(1)_OUTDIR)) +endif + +$$($(1)_OUTDIR)/$(1)$(LIB_EXT) : $$($(1)_OBJS) $$($(1)_EXTRADEPS) + $(if $(QUIET), @echo [AR] $$@) + $(QUIET)$(AR) cr$(if $(QUIET),,v) $$@ $$($(1)_OBJS) + +$$($(1)_OUTDIR)/$(1)$(OMF_LIB_EXT) : $$($(1)_OUTDIR)/$(1)$(LIB_EXT) + $(if $(QUIET), @echo [EMXOMF] $$@) + $(QUIET)emxomf -o $$@ $$($(1)_OUTDIR)/$(1)$(LIB_EXT) + +$(1) : $$($(1)_OUTDIR)/$(1)$(LIB_EXT) $$($(1)_OUTDIR)/$(1)$(OMF_LIB_EXT) +endef + +# template to build DLL +define dll_template +$(1)_DEPS := $(foreach s,$($(1)_SRCS),$(s:$(suffix $(s))=.d)) +$$($(1)_DEPS) : CFLAGS += $($(1)_CFLAGS) +$$($(1)_DEPS) : CXXFLAGS += $($(1)_CXXFLAGS) + +$(1)_OBJS := $$($(1)_DEPS:.d=$(OBJ_EXT)) +$$($(1)_OBJS) : CFLAGS += $($(1)_CFLAGS) +$$($(1)_OBJS) : CXXFLAGS += $($(1)_CXXFLAGS) + +$(1)_RES := $($(1)_RCSRC:.rc=.res) + +$(1)_OUTDIR := $(if $($(1)_OUTDIR),$($(1)_OUTDIR),.) + +$(1)_DEF := $(if $($(1)_DEF),$($(1)_DEF),$($(1)_OUTDIR)/$(1)_auto.def) + +$(1)_DLL_TARGET := $(if $($(1)_DLLNAME),$($(1)_DLLNAME),$(1))$(DLL_EXT) + +$(1)_DLL_LIBNAME := $$(notdir $$(basename $$($(1)_DLL_TARGET))) + +$(1)_DESC := $(if $($(1)_DESC),$($(1)_DESC),$(1)) + +# create a output directory +ifneq ($$($(1)_OUTDIR),.) +$$(shell $(MKDIR_P) $$($(1)_OUTDIR)) +endif + +ifneq ($$(wildcard $(1)_auto.def),) +ifneq ($$(shell sed -n -e "1s/^LIBRARY[ \t]\+\([^ \t]\+\).*$$$$/\1/p" $$($(1)_DEF)),$$($(1)_DLL_LIBNAME)) +$$(shell touch $$($(1)_OUTDIR)/$(1)_auto.libname) +endif +endif + +$$($(1)_OUTDIR)/$(1)_auto.libname : + $(if $(QUIET), @echo [TOUCH] $$@) + $(QUIET)touch $$@ + +$$($(1)_OUTDIR)/$(1)_auto.def : $$($(1)_OBJS) $$($(1)_OUTDIR)/$(1)_auto.libname + $(if $(QUIET), @echo [GEN] $$@) + $(QUIET)echo LIBRARY $$($(1)_DLL_LIBNAME) INITINSTANCE TERMINSTANCE > $$@ + $(QUIET)echo DATA MULTIPLE NONSHARED >> $$@ +ifeq ($(strip $$($(1)_NO_EXPORT)),) + $(QUIET)echo EXPORTS >> $$@ + $(QUIET)emxexp $$($(1)_OBJS) | sed /_DLL_InitTerm/d >> $$@ +endif + +$$($(1)_OUTDIR)/$$($(1)_DLL_TARGET) : $$($(1)_OBJS) $$($(1)_RES) $$($(1)_DEF) $$($(1)_EXTRADEPS) + $(if $(QUIET), @echo [LD] $$@) + $(QUIET)$(LD) -Zdll $(LDFLAGS) $$($(1)_LDFLAGS) -o $$@ $$($(1)_OBJS) $$($(1)_DEF) $(LDLIBS) $$($(1)_LDLIBS) +ifneq ($$($(1)_RES),) +ifeq ($(strip $(NO_COMPRESS_RES)),) + $(if $(QUIET), @echo [BIND] $$($(1)_RES) to $$@) + $(QUIET)$(RC) $$($(1)_RES) $$@ +endif +endif + $(if $(QUIET), @echo [LXLITE] $$@) + $(QUIET)$(LXLITE) $$@ +ifneq ($$($(1)_RES),) +ifneq ($(strip $(NO_COMPRESS_RES)),) + $(if $(QUIET), @echo [BIND] $$($(1)_RES) to $$@) + $(QUIET)$(RC) $$($(1)_RES) $$@ +endif +endif + $(if $(QUIET), @echo [BLDLEVEL] $$@) + $(QUIET)echo $(BLDLEVEL)$$($(1)_DESC) >> $$@ + +$$($(1)_OUTDIR)/$(1)_dll$(LIB_EXT) : $$($(1)_OUTDIR)/$$($(1)_DLL_TARGET) +ifeq ($$($(1)_NO_IMPLIB),) + $(if $(QUIET), @echo [IMPLIB] $$@) + $(QUIET)emximp -o $$@ $$($(1)_OUTDIR)/$$($(1)_DLL_TARGET) +endif + +$$($(1)_OUTDIR)/$(1)_dll$(OMF_LIB_EXT) : $$($(1)_OUTDIR)/$$($(1)_DLL_TARGET) +ifeq ($$($(1)_NO_IMPLIB),) + $(if $(QUIET), @echo [IMPLIB] $$@) + $(QUIET)emximp -o $$@ $$($(1)_OUTDIR)/$$($(1)_DLL_TARGET) +endif + +$(1) : $$($(1)_OUTDIR)/$(1)_dll$(LIB_EXT) $$($(1)_OUTDIR)/$(1)_dll$(OMF_LIB_EXT) +endef + +%.d : %.c + $(if $(QUIET), @echo [DEP] $@) + $(QUIET)$(CC) $(CFLAGS) -MM -MP -MT "$(@:.d=$(OBJ_EXT)) $@" -MF $@ $< + +%.d : %.cpp + $(if $(QUIET), @echo [DEP] $@) + $(QUIET)$(CXX) $(CXXFLAGS) -MM -MP -MT "$(@:.d=$(OBJ_EXT)) $@" -MF $@ $< + +%.o : %.c + $(if $(QUIET), @echo [CC] $@) + $(QUIET)$(CC) $(CFLAGS) -c -o $@ $< + +%.obj : %.c + $(if $(QUIET), @echo [CC] $@) + $(QUIET)$(CC) -Zomf $(CFLAGS) -c -o $@ $< + +%.o : %.cpp + $(if $(QUIET), @echo [CXX] $@) + $(QUIET)$(CXX) $(CXXFLAGS) -c -o $@ $< + +%.obj : %.cpp + $(if $(QUIET), @echo [CXX] $@) + $(QUIET)$(CXX) -Zomf $(CXXFLAGS) -c -o $@ $< + +%.res : %.rc + $(if $(QUIET), @echo [RC] $@) + $(QUIET)$(RC) $(RCFLAGS) -r $< $@ + +.PHONY : all $(BIN_PROGRAMS) $(BIN_LIBRARIES) clean $(SUBDIRS) + +all : $(SUBDIRS) $(BIN_LIBRARIES) $(BIN_PROGRAMS) + +# check if both library_LIB and library_DLL is not set +$(foreach lib,$(BIN_LIBRARIES),$(if $(strip $($(lib)_LIB)$($(lib)_DLL)),,$(error Either of $(lib)_LIB or $(lib)_DLL SHOULD be SET))) + +LIB_ENABLED = $(foreach lib,$(1),$(if $($(lib)_LIB),$(lib))) +DLL_ENABLED = $(foreach dll,$(1),$(if $($(dll)_DLL),$(dll))) + +$(foreach prog,$(BIN_PROGRAMS),$(eval $(call program_template,$(prog)))) +$(foreach lib,$(call LIB_ENABLED,$(BIN_LIBRARIES)),$(eval $(call lib_template,$(lib)))) +$(foreach dll,$(call DLL_ENABLED,$(BIN_LIBRARIES)),$(eval $(call dll_template,$(dll)))) + +clean : $(SUBDIRS) + rm -f $(foreach prog,$(BIN_PROGRAMS),$($(prog)_DEPS:.d=.bak)) + rm -f $(foreach prog,$(BIN_PROGRAMS),$($(prog)_DEPS)) + rm -f $(foreach prog,$(BIN_PROGRAMS),$($(prog)_OBJS)) + rm -f $(foreach prog,$(BIN_PROGRAMS),$($(prog)_RES)) + rm -f $(foreach prog,$(BIN_PROGRAMS),$(addsuffix $(EXE_EXT),$($(prog)_OUTDIR)/$(prog))) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_DEPS:.d=.bak)) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_DEPS)) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_OBJS)) + rm -f $(foreach lib,$(BIN_LIBRARIES),$(addsuffix $(LIB_EXT),$($(lib)_OUTDIR)/$(lib))) + rm -f $(foreach lib,$(BIN_LIBRARIES),$(addsuffix $(OMF_LIB_EXT),$($(lib)_OUTDIR)/$(lib))) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_RES)) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_OUTDIR)/$(lib)_auto.def) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_OUTDIR)/$(lib)_auto.libname) + rm -f $(foreach lib,$(BIN_LIBRARIES),$(addsuffix _dll$(LIB_EXT),$($(lib)_OUTDIR)/$(lib))) + rm -f $(foreach lib,$(BIN_LIBRARIES),$(addsuffix _dll$(OMF_LIB_EXT),$($(lib)_OUTDIR)/$(lib))) + rm -f $(foreach lib,$(BIN_LIBRARIES),$($(lib)_OUTDIR)/$($(lib)_DLL_TARGET)) + rm -f $(CLEAN-FILES) + +$(SUBDIRS) : + $(MAKE) -C $@ RELEASE=$(RELEASE) $(MAKECMDGOALS) + +ifeq ($(filter %clean, $(MAKECMDGOALS)),) +-include $(foreach prog,$(BIN_PROGRAMS),$($(prog)_DEPS)) +-include $(foreach lib,$(BIN_LIBRARIES),$($(lib)_DEPS)) +endif diff --git a/check.cmd b/check.cmd index c01b44c..fd0b470 100755 --- a/check.cmd +++ b/check.cmd @@ -58,6 +58,8 @@ call checkCC 'network/xpoll.h', 'network/xpoll.c network/poll.c', , 'xpoll_query( xpset, 0, 0 );' || g.sNl ||, 'xpoll_wait( xpset, 0, 0, 0 );'; +call checkOS2CompatHeader; + say 'Check completed'; exit 0; @@ -115,3 +117,33 @@ checkCC: procedure expose G. say 'Check passed'; return; + +checkOS2CompatHeader: procedure expose G. + sHeaderFiles = 'include/os2compat/dirent.h', + 'include/os2compat/netdb.h', + 'include/os2compat/poll.h', + 'include/os2compat/semaphore.h', + 'include/os2compat/net/if.h', + 'include/os2compat/sys/mman.h', + 'include/os2compat/sys/socket.h', + 'include/os2compat/sys/xpoll.h'; + sPrivHeaderFiles = 'io/scandir.h', + 'memory/mmap.h', + 'network/cmsg.h', + 'network/getaddrinfo.h', + 'network/if_nameindex.h', + 'network/poll.h', + 'network/shutdown.h', + 'network/socklen_t.h', + 'network/xpoll.h', + 'thread/semaphore.h'; + sDestDir = 'include/os2compat/priv'; + + address cmd 'ginstall -d' sDestDir; + address cmd 'cp -p --parent' sPrivHeaderFiles sDestDir; + + call checkCC sHeaderFiles; + + address cmd 'rm -rf' sDestDir; + + return; diff --git a/include/os2compat/dirent.h b/include/os2compat/dirent.h new file mode 100644 index 0000000..f6fd3c0 --- /dev/null +++ b/include/os2compat/dirent.h @@ -0,0 +1,18 @@ +/* + * dirent.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_DIRENT_H +#define OS2COMPAT_INCLUDE_DIRENT_H + +#include "priv/io/scandir.h" + +#endif diff --git a/include/os2compat/net/if.h b/include/os2compat/net/if.h new file mode 100644 index 0000000..6ce686b --- /dev/null +++ b/include/os2compat/net/if.h @@ -0,0 +1,18 @@ +/* + * net/if.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_NET_IF_H +#define OS2COMPAT_INCLUDE_NET_IF_H + +#include "../priv/network/if_nameindex.h" + +#endif diff --git a/include/os2compat/netdb.h b/include/os2compat/netdb.h new file mode 100644 index 0000000..8df0652 --- /dev/null +++ b/include/os2compat/netdb.h @@ -0,0 +1,18 @@ +/* + * netdb.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_NETDB_H +#define OS2COMPAT_INCLUDE_NETDB_H + +#include "priv/network/getaddrinfo.h" + +#endif diff --git a/include/os2compat/poll.h b/include/os2compat/poll.h new file mode 100644 index 0000000..65e0227 --- /dev/null +++ b/include/os2compat/poll.h @@ -0,0 +1,18 @@ +/* + * poll.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_POLL_H +#define OS2COMPAT_INCLUDE_POLL_H + +#include "priv/network/poll.h" + +#endif diff --git a/include/os2compat/semaphore.h b/include/os2compat/semaphore.h new file mode 100644 index 0000000..f813ada --- /dev/null +++ b/include/os2compat/semaphore.h @@ -0,0 +1,18 @@ +/* + * semaphore.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_SEMAPHORE_H +#define OS2COMPAT_INCLUDE_SEMAPHORE_H + +#include "priv/thread/semaphore.h" + +#endif diff --git a/include/os2compat/sys/mman.h b/include/os2compat/sys/mman.h new file mode 100644 index 0000000..a622e77 --- /dev/null +++ b/include/os2compat/sys/mman.h @@ -0,0 +1,18 @@ +/* + * sys/mman.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_SYS_MMAN_H +#define OS2COMPAT_INCLUDE_SYS_MMAN_H + +#include "../priv/memory/mmap.h" + +#endif diff --git a/include/os2compat/sys/socket.h b/include/os2compat/sys/socket.h new file mode 100644 index 0000000..e0f10c3 --- /dev/null +++ b/include/os2compat/sys/socket.h @@ -0,0 +1,20 @@ +/* + * sys/socket.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_SYS_SOCKET_H +#define OS2COMPAT_INCLUDE_SYS_SOCKET_H + +#include "../priv/network/cmsg.h" +#include "../priv/network/shutdown.h" +#include "../priv/network/socklen_t.h" + +#endif diff --git a/include/os2compat/sys/xpoll.h b/include/os2compat/sys/xpoll.h new file mode 100644 index 0000000..82d2556 --- /dev/null +++ b/include/os2compat/sys/xpoll.h @@ -0,0 +1,18 @@ +/* + * xpoll.h for os2compat + * + * Copyright (C) 2022 KO Myung-Hun + * + * This program is free software. It comes without any warranty, to + * the extent permitted by applicable law. You can redistribute it + * and/or modify it under the terms of the Do What The Fuck You Want + * To Public License, Version 2, as published by Sam Hocevar. See + * http://www.wtfpl.net/ for more details. + */ + +#ifndef OS2COMPAT_INCLUDE_SYS_XPOLL_H +#define OS2COMPAT_INCLUDE_SYS_XPOLL_H + +#include "../priv/network/xpoll.h" + +#endif