Skip to content

Commit

Permalink
More MHS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
augustss committed Nov 11, 2024
1 parent f4a3506 commit 3ec895e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/ci.mhs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MicroHs CI for time
name: ci-mhs

on:
push:
Expand All @@ -13,7 +13,7 @@ jobs:
- name: checkout time repo
uses: actions/checkout@v4
with:
path: tim
path: time
- name: checkout mhs repo
uses: actions/checkout@v4
with:
Expand All @@ -29,4 +29,14 @@ jobs:
- name: compile time package
run: |
cd mhs
MHSCPPHS=./bin/cpphs ./bin/mhs -Ptime-test -otime-test.pkg -i../tim/lib -idist-mcabal/autogen -I../tim/lib/include '-DVERSION_base=\"4.19.1.0\"' '-DMIN_VERSION_base(x,y,z)=((x)<4||(x)==4&&(y)<19||(x)==4&&(y)==19&&(z)<=1)' '-DVERSION_deepseq=\"1.5.0.0\"' '-DMIN_VERSION_deepseq(x,y,z)=((x)<1||(x)==1&&(y)<5||(x)==1&&(y)==5&&(z)<=0)' Data.Time.Calendar Data.Time.Calendar.MonthDay Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Calendar.Month Data.Time.Calendar.Quarter Data.Time.Clock Data.Time.Clock.System Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime Data.Time.Format Data.Time.Format.Internal Data.Time.Format.ISO8601 Data.Time
MHSCPPHS=./bin/cpphs ./bin/mhs -Ptime-test -otime-test.pkg -i../time/lib -idist-mcabal/autogen -I../time/lib/include '-DVERSION_base=\"4.19.1.0\"' '-DMIN_VERSION_base(x,y,z)=((x)<4||(x)==4&&(y)<19||(x)==4&&(y)==19&&(z)<=1)' '-DVERSION_deepseq=\"1.5.0.0\"' '-DMIN_VERSION_deepseq(x,y,z)=((x)<1||(x)==1&&(y)<5||(x)==1&&(y)==5&&(z)<=0)' Data.Time.Calendar Data.Time.Calendar.MonthDay Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Calendar.Month Data.Time.Calendar.Quarter Data.Time.Clock Data.Time.Clock.System Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime Data.Time.Format Data.Time.Format.Internal Data.Time.Format.ISO8601 Data.Time
- name: run ShowDefaultTZAbbreviations test
run: |
cd mhs
MHSCPPHS=./bin/cpphs ./bin/mhs -i../time/lib -idist-mcabal/autogen -I../time/lib/include '-DVERSION_base=\"4.19.1.0\"' '-DMIN_VERSION_base(x,y,z)=((x)<4||(x)==4&&(y)<19||(x)==4&&(y)==19&&(z)<=1)' '-DVERSION_deepseq=\"1.5.0.0\"' '-DMIN_VERSION_deepseq(x,y,z)=((x)<1||(x)==1&&(y)<5||(x)==1&&(y)==5&&(z)<=0)' -i../time/test ../time/test/ShowDefaultTZAbbreviations.hs ../time/lib/cbits/HsTime.c -oShowDefaultTZAbbreviations
./ShowDefaultTZAbbreviations
- name: run ShowTime test
run: |
cd mhs
MHSCPPHS=./bin/cpphs ./bin/mhs -i../time/lib -idist-mcabal/autogen -I../time/lib/include '-DVERSION_base=\"4.19.1.0\"' '-DMIN_VERSION_base(x,y,z)=((x)<4||(x)==4&&(y)<19||(x)==4&&(y)==19&&(z)<=1)' '-DVERSION_deepseq=\"1.5.0.0\"' '-DMIN_VERSION_deepseq(x,y,z)=((x)<1||(x)==1&&(y)<5||(x)==1&&(y)==5&&(z)<=0)' -i../time/test ../time/test/ShowTime.hs ../time/lib/cbits/HsTime.c -oShowTime
./ShowTime
2 changes: 1 addition & 1 deletion lib/cbits/HsTime.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ long int get_current_timezone_seconds (time_t t,int* pdst,char const* * pname)
*pname = dst ? _tzname[1] : _tzname[0];
return - (dst ? _timezone - 3600 : _timezone);
#else
# if HAVE_TZNAME
# if HAVE_TZNAME || defined(__MHS__)
*pname = *tzname;
# else
# error "Don't know how to get timezone name on your OS"
Expand Down
2 changes: 1 addition & 1 deletion lib/include/HsTime.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __HSTIME_H__
#define __HSTIME_H__

#if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32) || defined(__MHS__)
#define HAVE_TIME_H 1
#else

Expand Down

0 comments on commit 3ec895e

Please sign in to comment.