Skip to content

Commit

Permalink
Adding @library annotation everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
ravimad committed Sep 19, 2016
1 parent 8d99391 commit c3dd7a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions library/leon/io/StdOut.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@ import leon.annotation._
object StdOut {

@extern
@library
@cCode.function(
code = """
|void __FUNCTION__(char* s) {
| printf("%s", s);
|}
""",
includes = "stdio.h"
)
)
def print(x: String): Unit = {
scala.Predef.print(x)
}

@library
def println(s: String): Unit = {
print(s)
print('\n')
}

@library
@extern
@cCode.function(
code = """
Expand All @@ -32,16 +35,18 @@ object StdOut {
|}
""",
includes = "inttypes.h:stdio.h"
)
)
def print(x: Int): Unit = {
scala.Predef.print(x)
}

@library
def println(x: Int): Unit = {
print(x)
print('\n')
}

@library
@extern
@cCode.function(
code = """
Expand All @@ -55,11 +60,13 @@ object StdOut {
scala.Predef.print(c)
}

@library
def println(c: Char): Unit = {
print(c)
print('\n')
}

@library
def println(): Unit = {
print('\n')
}
Expand Down

0 comments on commit c3dd7a0

Please sign in to comment.