Skip to content

Commit

Permalink
Merge pull request #4703 from WalterBright/rmMSDOS
Browse files Browse the repository at this point in the history
Remove DOS386, DOS16RM
  • Loading branch information
yebblies committed Jun 1, 2015
2 parents 2f4e62e + ba34b37 commit 3f40636
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 53 deletions.
4 changes: 0 additions & 4 deletions src/backend/cdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ One and only one of these macros must be set by the makefile:
#define SUFFIX "a"
#elif _WIN32
#define SUFFIX "n"
#elif DOS386
#define SUFFIX "x"
#elif DOS16RM
#define SUFFIX "r"
#else
#define SUFFIX ""
#endif
Expand Down
54 changes: 5 additions & 49 deletions src/backend/os.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 1994-1998 by Symantec
// Copyright (C) 2000-2009 by Digital Mars
// Copyright (C) 2000-2015 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
Expand All @@ -20,11 +20,6 @@
#include <stdlib.h>
#include <string.h>

#if DOS386
#include <dos.h>
#include <sys\stat.h>
#endif

#if __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun
#include <sys/types.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -610,32 +605,6 @@ unsigned long os_unique()
return x;
}

#elif DOS386

//////////////////////////////////////////
// Return a value that will hopefully be unique every time
// we call it.

unsigned long os_unique()
{
if (cputype() >= 5) // if cpuid instruction supported
{
__asm
{
mov EAX,1
cpuid
test EDX,0x20 // is rdtsc supported?
jz L1 // no
rdtsc
}
}
else
{
L1: time(NULL);
}
return _EAX;
}

#endif

/*******************************************
Expand All @@ -651,21 +620,14 @@ int os_file_exists(const char *name)
DWORD dw;
int result;

dw = GetFileAttributes(name);
dw = GetFileAttributesA(name);
if (dw == -1L)
result = 0;
else if (dw & FILE_ATTRIBUTE_DIRECTORY)
result = 2;
else
result = 1;
return result;
#elif DOS386
struct FIND *find;

find = findfirst(name,FA_DIREC | FA_SYSTEM | FA_HIDDEN);
if (!find)
return 0;
return (find->attribute & FA_DIREC) ? 2 : 1;
#elif __linux__ || __APPLE__ || __FreeBSD__ || __OpenBSD__ || __sun
struct stat buf;

Expand Down Expand Up @@ -710,7 +672,7 @@ char *file_8dot3name(const char *filename)
char *buf;
int i;

h = FindFirstFile(filename,&fileinfo);
h = FindFirstFileA(filename,&fileinfo);
if (h == INVALID_HANDLE_VALUE)
return NULL;
if (fileinfo.cAlternateFileName[0])
Expand Down Expand Up @@ -770,15 +732,15 @@ int file_write(char *name, void *buffer, unsigned len)
HANDLE h;
DWORD numwritten;

h = CreateFileA((LPTSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
h = CreateFileA((LPCSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
if (h == INVALID_HANDLE_VALUE)
{
if (GetLastError() == ERROR_PATH_NOT_FOUND)
{
if (!file_createdirs(name))
{
h = CreateFileA((LPTSTR)name,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
h = CreateFileA((LPCSTR)name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,NULL);
if (h != INVALID_HANDLE_VALUE)
goto Lok;
Expand All @@ -803,9 +765,6 @@ int file_write(char *name, void *buffer, unsigned len)
err:
return 1;
#endif
#if _MSDOS
return 1;
#endif
}

/********************************
Expand Down Expand Up @@ -853,9 +812,6 @@ int file_createdirs(char *name)
Lfail:
return 1;
#endif
#if _MSDOS
return 1;
#endif
}

/***********************************
Expand Down

0 comments on commit 3f40636

Please sign in to comment.