Skip to content

Commit

Permalink
release: beta-v0.0.4 (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamesbarford authored Nov 3, 2024
1 parent a37294c commit db8808e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/cctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static void cctrlAddBuiltinMacros(Cctrl *cc) {
struct timeval tm;
long milliseconds,len;
time_t seconds;
char *date,*time,*time_stamp,*version;
char *date,*time,*time_stamp;
long bufsize = sizeof(char)*128;

le = lexemeSentinal();
Expand Down Expand Up @@ -91,7 +91,6 @@ static void cctrlAddBuiltinMacros(Cctrl *cc) {
time = malloc(bufsize);
date = malloc(bufsize);
time_stamp = malloc(bufsize);
version = malloc(bufsize);

len = snprintf(time,bufsize,"%02d:%02d:%02d",
ptm->tm_hour,ptm->tm_min,ptm->tm_sec);
Expand Down Expand Up @@ -122,9 +121,7 @@ static void cctrlAddBuiltinMacros(Cctrl *cc) {
dictSet(cc->macro_defs,"__HCC_LINK_SQLITE3__",le);
#endif

len = snprintf(version,bufsize,"v0.0.2-alpha");
version[len] = '\0';
le = lexemeNew(version,len);
le = lexemeNew((char *)cctrlGetVersion(),len);
le->tk_type = TK_STR;
dictSet(cc->macro_defs,"__HCC_VERSION__",le);
}
Expand Down
6 changes: 6 additions & 0 deletions src/cctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
#include "dict.h"
#include "lexer.h"

#define HCC_VERSION "beta-v0.0.4"

static const char *cctrlGetVersion(void) {
return HCC_VERSION;
}

typedef struct TokenIter {
/* All of the tokens */
List *tokens;
Expand Down
6 changes: 1 addition & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ typedef struct hccLib {
char *install_cmd;
} hccLib;

char *getVersion(void) {
return "0.0.2";
}

int hccLibInit(hccLib *lib, hccOpts *opts, char *name) {
aoStr *dylibcmd = aoStrNew();
aoStr *stylibcmd = aoStrNew();
Expand Down Expand Up @@ -276,7 +272,7 @@ void usage(void) {
" -g Not implemented\n"
" -D<var> Set a compiler #define (does not accept a value)\n"
" --help Print this message\n",
getVersion());
cctrlGetVersion());
exit(1);
}

Expand Down

0 comments on commit db8808e

Please sign in to comment.