Skip to content

Commit

Permalink
haiku: adding support to v #1
Browse files Browse the repository at this point in the history
  • Loading branch information
M4SSD35TRUCT10N authored and medvednikov committed Nov 24, 2019
1 parent 19b4cf6 commit f496c1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
24 changes: 13 additions & 11 deletions vlib/compiler/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,18 @@ fn build_thirdparty_obj_file(path string, moduleflags []CFlag) {

fn os_name_to_ifdef(name string) string {
match name {
'windows' { return '_WIN32'}
'mac' { return '__APPLE__'}
'linux' { return '__linux__'}
'freebsd' { return '__FreeBSD__'}
'openbsd'{ return '__OpenBSD__'}
'netbsd'{ return '__NetBSD__'}
'dragonfly'{ return '__DragonFly__'}
'msvc'{ return '_MSC_VER'}
'android'{ return '__BIONIC__'}
'js' {return '_VJS'}
'solaris'{ return '__sun'}
'windows' { return '_WIN32' }
'mac' { return '__APPLE__' }
'linux' { return '__linux__' }
'freebsd' { return '__FreeBSD__' }
'openbsd'{ return '__OpenBSD__' }
'netbsd'{ return '__NetBSD__' }
'dragonfly'{ return '__DragonFly__' }
'msvc'{ return '_MSC_VER' }
'android'{ return '__BIONIC__' }
'js' {return '_VJS' }
'solaris'{ return '__sun' }
'haiku' { return '__haiku__' }
}
verror('bad os ifdef name "$name"')
return ''
Expand All @@ -309,6 +310,7 @@ fn platform_postfix_to_ifdefguard(name string) string {
'_lin.v', '_linux.v' { '#ifdef __linux__' }
'_mac.v', '_darwin.v' { '#ifdef __APPLE__' }
'_solaris.v' { '#ifdef __sun' }
'_haiku.v' { '#ifdef __haiku__' }
else {

//verror('bad platform_postfix "$name"')
Expand Down
3 changes: 2 additions & 1 deletion vlib/compiler/main.v
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum BuildMode {

const (
supported_platforms = ['windows', 'mac', 'linux', 'freebsd', 'openbsd',
'netbsd', 'dragonfly', 'android', 'js', 'solaris']
'netbsd', 'dragonfly', 'android', 'js', 'solaris', 'haiku']
)

enum OS {
Expand All @@ -40,6 +40,7 @@ enum OS {
js // TODO
android
solaris
haiku
}

enum Pass {
Expand Down

0 comments on commit f496c1b

Please sign in to comment.