Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow named exports #14

Merged
merged 3 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- '*-dev'

env:
REGISTRY: ghcr.io
Expand All @@ -24,9 +25,10 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value={{date 'YYYYMMDD'}}-{{sha}}
type=raw,value={{date 'YYYYMMDD'}}
type=raw,value=latest
type=raw,value={{branch}}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ github.ref != format('refs/heads/{0}', 'main') }}
type=raw,value={{date 'YYYYMMDD'}}-{{sha}},enable={{is_default_branch}}
type=raw,value={{date 'YYYYMMDD'}},enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include $(TOPDIR)/share/wums_rules

export WUMS_MAJOR := 0
export WUMS_MINOR := 3
export WUMS_PATCH := 1
export WUMS_PATCH := 2

VERSION := $(WUMS_MAJOR).$(WUMS_MINOR).$(WUMS_PATCH)

Expand Down
6 changes: 4 additions & 2 deletions include/wums/exports.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ typedef struct wums_entry_t {
const void *address; /* pointer to the export */
} wums_loader_entry_t;

#define WUMS_EXPORT_FUNCTION(function) WUMS_EXPORT(WUMS_FUNCTION_EXPORT, function, function)
#define WUMS_EXPORT_DATA(pointer) WUMS_EXPORT(WUMS_DATA_EXPORT, pointer, &pointer)
#define WUMS_EXPORT_FUNCTION_EX(function, name) WUMS_EXPORT(WUMS_FUNCTION_EXPORT, name, function)
#define WUMS_EXPORT_FUNCTION(function) WUMS_EXPORT_FUNCTION_EX(function, function)
#define WUMS_EXPORT_DATA_EX(pointer, name) WUMS_EXPORT(WUMS_DATA_EXPORT, name, &pointer)
#define WUMS_EXPORT_DATA(pointer) WUMS_EXPORT_DATA_EX(pointer, pointer)

#define WUMS_EXPORT(_type, pointer, value) \
extern const wums_loader_entry_t wums_entry_##pointer \
Expand Down
Loading