Skip to content

Commit

Permalink
Function names are now delimited with "~" from the namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMagnus committed Feb 18, 2024
1 parent 4ee9372 commit 789b0c8
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/platforms/amd64/linux/conversion.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "../../common/types.h"
#include "string.h"

String intToString (Int integer) asm ("Standard.Conversion.intToString");
String intToString (Int integer) asm ("\"Standard.Conversion~intToString\"");
String intToString (Int integer)
{
// The following is a hack.
Expand Down Expand Up @@ -43,7 +43,7 @@ String intToString (Int integer)
return result;
}

Int stringToInt (const String string) asm ("Standard.Conversion.stringToInt");
Int stringToInt (const String string) asm ("\"Standard.Conversion~stringToInt\"");
Int stringToInt (const String string)
{
if (string->size == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/amd64/linux/conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* Converts an integer into a string.
* @return A new string instance, representing the given integer value.
*/
String intToString (Int integer) asm ("Standard.Conversion.intToString");
String intToString (Int integer) asm ("\"Standard.Conversion~intToString\"");

/**
* Convert a string into an integer.
* @return The integer value the given string represents.
*/
Int stringToInt (const String string) asm ("Standard.Conversion.stringToInt");
Int stringToInt (const String string) asm ("\"Standard.Conversion~stringToInt\"");
6 changes: 3 additions & 3 deletions src/platforms/amd64/linux/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Writes a string to the standard output.
* @param text The string to write.
*/
void write (const String text) asm ("Standard.Io.write");
void write (const String text) asm ("\"Standard.Io~write\"");
void write (const String text)
{
Int fileDescriptor = 1; // File descriptor ID for stdout
Expand All @@ -26,7 +26,7 @@ void write (const String text)
* Writes a string to the standard output, followed by a line break.
* @param text The string to write.
*/
void writeLine (const String text) asm ("Standard.Io.writeLine");
void writeLine (const String text) asm ("\"Standard.Io~writeLine\"");
void writeLine (const String text)
{
UInt8* lineBreakLiteralChar = { "\n" };
Expand All @@ -45,7 +45,7 @@ void writeLine (const String text)
* Reads a line from the standard input.
* @return The string that has been read in. Does not include the line break.
*/
String readLine () asm ("Standard.Io.readLine");
String readLine () asm ("\"Standard.Io~readLine\"");
String readLine ()
{
Int fileDescriptor = 0; // File descriptor ID for stdin
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/amd64/linux/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @param size The size of the memory block to allocate.
* @return The pointer to the allocated memory.
*/
void* allocate (UInt size) asm ("Standard.Memory.allocate");
void* allocate (UInt size) asm ("\"Standard.Memory~allocate\"");
void* allocate (UInt size)
{
void* address = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/amd64/linux/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#include "../../common/memory.h"
#include "../../common/types.h"

void* allocate (UInt size) asm ("Standard.Memory.allocate");
void* allocate (UInt size) asm ("\"Standard.Memory~allocate\"");
void free (const void* address, UInt size);
4 changes: 2 additions & 2 deletions src/platforms/amd64/linux/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

static Int seed = 0;

void randomise () asm ("Standard.Random.randomise");
void randomise () asm ("\"Standard.Random~randomise\"");
void randomise ()
{
UInt syscode = SYSCODE_GET_RANDOM;
Expand All @@ -29,7 +29,7 @@ void randomise ()
// TODO: Check return value.
}

Int getRandom (Int range) asm ("Standard.Random.getRandom");
Int getRandom (Int range) asm ("\"Standard.Random~getRandom\"");
Int getRandom (Int range)
{
seed = (seed * 1103515245 + 12345);
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/amd64/linux/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

void randomise () asm ("Standard.Random.randomise");

Int getRandom (Int range) asm ("Standard.Random.getRandom");
Int getRandom (Int range) asm ("Standard.Random..getRandom");
2 changes: 1 addition & 1 deletion src/platforms/amd64/linux/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct SleepTimeSpec
* Waits for the given amount of milliseconds.
* @param milliseconds The number of milliseconds to wait for.
*/
void sleep (UInt milliseconds) asm ("Standard.Sleep.sleep");
void sleep (UInt milliseconds) asm ("\"Standard.Sleep~sleep\"");
void sleep (UInt milliseconds)
{
struct SleepTimeSpec sleepTimeSpec = {
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/common/string.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "types.h"
#include "string.h"

Bool stringsAreEqual (const String string1, const String string2) asm ("Standard.String.stringsAreEqual");
Bool stringsAreEqual (const String string1, const String string2) asm ("\"Standard.String~stringsAreEqual\"");
Bool stringsAreEqual (const String string1, const String string2)
{
if (string1->size != string2->size)
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/common/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ typedef struct
*/
typedef const StringValue* String;

Bool stringsAreEqual (const String string1, const String string2) asm ("Standard.String.stringsAreEqual");
Bool stringsAreEqual (const String string1, const String string2) asm ("\"Standard.String~stringsAreEqual\"");

0 comments on commit 789b0c8

Please sign in to comment.