Skip to content

Commit

Permalink
initial support for unix
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jan 6, 2018
1 parent 479f003 commit 98d2908
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

.DS_Store

/mingus
/mingusa

/bin
/build
/win32/vs2008ex/*/*
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: mingus mingusa

clean:
rm -f mingus mingusa

mingus: src/mingus/mingus.c
gcc -lviriatum -lviriatum_http src/mingus/mingus.c -o mingus

mingusa: src/mingus_assembler/mingus_assembler.c
gcc -lviriatum -lviriatum_http src/mingus_assembler/mingus_assembler.c -o mingusa
1 change: 0 additions & 1 deletion src/mingus/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@
#include "targetver.h"

#include <stdio.h>
#include <tchar.h>

#include <viriatum/viriatum.h>
11 changes: 10 additions & 1 deletion src/mingus_assembler/mingus_assembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,23 @@ ERROR_CODE run(char *file_path, char *output_path) {
to be used as the output of the bytecode */
FILE *out;

/* in case the provided file path is not valid raises
and error indicating the problem */
if(file_path == NULL) {
RAISE_ERROR_M(
RUNTIME_EXCEPTION_ERROR_CODE,
(unsigned char *) "No input file"
);
}

/* counts the number of bytes in the asm file
and then opens the asm file to be assembled in
binary mode (required for parsing) */
return_value = count_file(file_path, &file_size);
if(IS_ERROR_CODE(return_value)) {
RAISE_ERROR_F(
RUNTIME_EXCEPTION_ERROR_CODE,
(unsigned char *) "Problem couting file %s",
(unsigned char *) "Problem counting file %s",
file_path
);
}
Expand Down
1 change: 0 additions & 1 deletion src/mingus_assembler/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "targetver.h"

#include <stdio.h>
#include <tchar.h>

#include <viriatum/viriatum.h>

Expand Down

0 comments on commit 98d2908

Please sign in to comment.