Skip to content
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ HOSTCC ?= cc

# ---- common flags ----

AMIGA_DATE ?= $(shell date '+%-d.%-m.%Y')
AMIGA_DATE ?= $(shell LC_ALL=C date '+%d.%m.%Y')
ODFS_GIT_VERSION ?= $(shell desc=$$(git describe --tags --match "v*" --dirty --always 2>/dev/null || echo unknown); printf '%s\n' "$$desc" | grep -q '^v' && printf '%s' "$$desc" || printf 'early-0-g%s' "$$desc")
ODFS_VERSION_MAJOR ?= $(or $(shell printf '%s\n' "$(ODFS_GIT_VERSION)" | sed -n 's/^v\([0-9][0-9]*\)\..*/\1/p'),0)
ODFS_VERSION_MINOR ?= $(or $(shell printf '%s\n' "$(ODFS_GIT_VERSION)" | sed -n 's/^v[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p'),0)
Expand Down
9 changes: 7 additions & 2 deletions platform/amiga/handler_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,14 @@
#define DMDF_REMOVEDEVICE (1L << 1)
#endif

#define ODFS_STR_(x) #x
#define ODFS_STR(x) ODFS_STR_(x)

/* Version reads the token after the name as <version>.<revision> */
const char version_string[] __attribute__((used)) =
"$VER: ODFileSystem " ODFS_GIT_VERSION
" (" ODFS_AMIGA_DATE ")";
"$VER: ODFileSystem "
ODFS_STR(ODFS_VERSION_MAJOR) "." ODFS_STR(ODFS_VERSION_MINOR)
" (" ODFS_AMIGA_DATE ") " ODFS_GIT_VERSION;

#define VOLUME_PUBLISH_RETRY_MICROS 100000UL

Expand Down
8 changes: 4 additions & 4 deletions platform/amiga/resident.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

extern const char version_string[];
static const char name_string[] = "ODFileSystem";
static const char creator_string[] =
"ODFileSystem " ODFS_GIT_VERSION " (" ODFS_AMIGA_DATE ")";
/* the cookie without its "$VER: " prefix */
#define ODFS_ID_STRING (&version_string[sizeof("$VER: ") - 1])

void entrypoint(void);
static int rt_init(BPTR seglist asm("a0"), struct ExecBase *SysBase asm("a6"));
Expand All @@ -49,7 +49,7 @@ static const struct Resident __attribute__((used,no_reorder)) romtag = {
.rt_Type = NT_UNKNOWN,
.rt_Pri = 10,
.rt_Name = (APTR)&name_string,
.rt_IdString = (APTR)&version_string,
.rt_IdString = (APTR)ODFS_ID_STRING,
.rt_Init = (APTR)rt_init
};

Expand Down Expand Up @@ -81,7 +81,7 @@ static int rt_init(BPTR seglist asm("a0"), struct ExecBase *SysBase asm("a6")) {
if (seglist == NULL) {
seglist = MKBADDR((UBYTE *)entrypoint - 4);
}
fse->fse_Node.ln_Name = (char *)creator_string;
fse->fse_Node.ln_Name = (char *)ODFS_ID_STRING;
fse->fse_DosType = DOSTYPE;
fse->fse_GlobalVec = -1;
fse->fse_PatchFlags = 0x190;
Expand Down
Loading