From 0b9c32ee98fb79de6a7085040a0e9512e6bb02d6 Mon Sep 17 00:00:00 2001 From: DoctorNoobingstoneIPresume Date: Mon, 2 Aug 2021 22:52:58 +0300 Subject: [PATCH] builtins.cpp: #ifdef OS_NT...#else...#endif part: more human-readable. --- src/engine/builtins.cpp | 57 +++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/engine/builtins.cpp b/src/engine/builtins.cpp index 86706a65b1..5b52b97dc0 100644 --- a/src/engine/builtins.cpp +++ b/src/engine/builtins.cpp @@ -30,38 +30,39 @@ #include "output.h" #include -#include #ifdef OS_NT -#include -#ifndef FSCTL_GET_REPARSE_POINT -/* MinGW's version of windows.h is missing this, so we need - * to include winioctl.h directly - */ -#include -#endif + #include + #ifndef FSCTL_GET_REPARSE_POINT + /* MinGW's version of windows.h is missing this, so we need + * to include winioctl.h directly + */ + #include + #endif -/* With VC8 (VS2005) these are not defined: - * FSCTL_GET_REPARSE_POINT (expects WINVER >= 0x0500 _WIN32_WINNT >= 0x0500 ) - * IO_REPARSE_TAG_SYMLINK (is part of a separate Driver SDK) - * So define them explicitly to their expected values. - */ -#ifndef FSCTL_GET_REPARSE_POINT -# define FSCTL_GET_REPARSE_POINT 0x000900a8 -#endif -#ifndef IO_REPARSE_TAG_SYMLINK -# define IO_REPARSE_TAG_SYMLINK (0xA000000CL) + /* With VC8 (VS2005) these are not defined: + * FSCTL_GET_REPARSE_POINT (expects WINVER >= 0x0500 _WIN32_WINNT >= 0x0500 ) + * IO_REPARSE_TAG_SYMLINK (is part of a separate Driver SDK) + * So define them explicitly to their expected values. + */ + #ifndef FSCTL_GET_REPARSE_POINT + #define FSCTL_GET_REPARSE_POINT 0x000900a8 + #endif + #ifndef IO_REPARSE_TAG_SYMLINK + #define IO_REPARSE_TAG_SYMLINK (0xA000000CL) + #endif + + #include + #if !defined(__BORLANDC__) + #define dup _dup + #define dup2 _dup2 + #define open _open + #define close _close + #endif +#else + #include #endif -#include -#if !defined(__BORLANDC__) -#define dup _dup -#define dup2 _dup2 -#define open _open -#define close _close -#endif /* __BORLANDC__ */ -#endif /* OS_NT */ - #if defined(USE_EXECUNIX) # include # include @@ -2401,7 +2402,7 @@ LIST * builtin_shell( FRAME * frame, int flags ) LIST * command = lol_get( frame->args, 0 ); LIST * result = L0; string s; - int32_t ret; + int32_t ret; char buffer[ 1024 ]; FILE * p = NULL; int exit_status = -1;