📝 change CRLF to LF

This commit is contained in:
ValKmjolnir 2023-12-02 19:42:21 +08:00
parent 476fbdb859
commit d42e4a5897
6 changed files with 1140 additions and 1141 deletions

View File

@ -1,5 +1,11 @@
#include "io_lib.h"
#ifdef _MSC_VER
#define F_OK 0 // fuck msc
#endif
#include <sys/stat.h>
namespace nasal {
const auto file_type_name = "file";

View File

@ -4,18 +4,12 @@
#include "nasal_gc.h"
#include "nasal_builtin.h"
#include <sys/stat.h>
#ifndef _MSC_VER
#include <unistd.h>
#else
#include <io.h>
#endif
#ifdef _MSC_VER
#define F_OK 0 // fuck msc
#endif
namespace nasal {
void filehandle_destructor(void*);

View File

@ -4,6 +4,10 @@
#include <memory>
#include <unordered_set>
#ifdef _MSC_VER
#define F_OK 0 // fuck msc
#endif
namespace nasal {
linker::linker(): show_path_flag(false), library_loaded(false), this_file("") {

View File

@ -8,10 +8,6 @@
#include <io.h>
#endif
#ifdef _MSC_VER
#define F_OK 0
#endif
#include "nasal.h"
#include "nasal_ast.h"
#include "nasal_lexer.h"

View File

@ -76,6 +76,9 @@ void lexer::open(const std::string& file) {
}
// check file exsits and it is a regular file
#ifdef _MSC_VER
#define S_ISREG(m) (((m)&0xF000)==0x8000)
#endif
struct stat buffer;
if (stat(file.c_str(), &buffer)==0 && !S_ISREG(buffer.st_mode)) {
err.err("lexer", "<"+file+"> is not a regular file");

View File

@ -15,10 +15,6 @@
#include "nasal.h"
#include "nasal_err.h"
#ifdef _MSC_VER
#define S_ISREG(m) (((m)&0xF000)==0x8000)
#endif
namespace nasal {
enum class tok:u32 {