This commit is contained in:
Shengliang Guan 2020-08-07 18:59:52 +08:00
parent 8e53280b3c
commit ef2f966da5
90 changed files with 140 additions and 2291 deletions

View File

@ -119,6 +119,7 @@ IF (TD_WINDOWS)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/wepoll/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/MsvcLibX/include)
ENDIF ()
IF (TD_WINDOWS_64)

View File

@ -1,30 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
IF (TD_WINDOWS_64)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(FindWindowsSDK)
get_mywindowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIR)
get_ucrt_include_dirs(${WINDOWSSDK_PREFERRED_DIR} UCRT_INCLUDE_DIR)
Add_Definitions("-DWSDKINCLUDE=${WINSDK_INCLUDE_DIR}")
include(FindMSVC)
Add_Definitions("-DMSVCINCLUDE=${VC_INCLUDE_DIR}")
IF ((NOT DEFINED UCRT_INCLUDE_DIR) OR (UCRT_INCLUDE_DIR STREQUAL "NOTFOUND"))
Message(STATUS "UCRT_INCLUDE_DIR notu found, set it to vc incude dir")
SET(UCRT_INCLUDE_DIR "${VC_INCLUDE_DIR}")
Add_Definitions("-DUCRTINCLUDE=${VC_INCLUDE_DIR}")
ELSE ()
Add_Definitions("-DUCRTINCLUDE=${UCRT_INCLUDE_DIR}")
ENDIF ()
Message(STATUS "WINSDK_INCLUDE_DIR: ${WINSDK_INCLUDE_DIR}")
Message(STATUS "UCRT_INCLUDE_DIR: ${UCRT_INCLUDE_DIR}")
Message(STATUS "VC_INCLUDE_DIR: ${VC_INCLUDE_DIR}")
IF (TD_WINDOWS)
INCLUDE_DIRECTORIES(include)
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(MsvcLibXw64 ${SRC})

View File

@ -1,820 +0,0 @@
MsvcLibX - A set of MSVC Library eXtensions
===========================================
Introduction
------------
The MsvcLibX library is built upon 30 years of work.
It exists because the Microsoft Visual C/C++ library is only a subset of the
standard C library, and I wanted to port to DOS and Windows programs using some
of the missing parts.
Initially Microsoft C compilers for MS-DOS tried to be as compliant as possible
with the standard C library. Then Microsoft rewrote their library for Windows.
But when the WIN32 API became prevalent, Microsoft apparently lost interest,
and stopped porting to MS-DOS and Windows the new C include files and library
routines that got standardized over the years.
To the point that's it's now impossible to rebuild any recent Posix/Unix/Linux
program using the MSVC library.
MsvcLibX adds a number of standard include files and library routines that I've
needed over the years. For example the directory access routines defined in
dirent.h, or the symbolic link support in unistd.h.
It also includes a number of useful routines and macros, either needed
internally to implement and debug the above, or made necessary by irresolvable
incompatibilities between Unix and Windows.
Other major features of the MsvcLibX library are:
* A powerful make system, based on Microsoft nmake files, that allow building
multiple versions of the same program (Ex: DOS/WIN32/WIN64) with one simple
command. And in most cases without having to write any dedicated make file.
* Support for UTF-8 sources, allowing to build programs working in any code page.
* Support for NTFS symlinks and junctions.
* Support for DOS, and Windows 95 targets, for targeting old computers.
* Support for bound DOS+Windows programs, for truly universal executables that
work in *all* versions of DOS and Windows.
An obvious alternative exists for building Windows programs: MinGW.
But I started all this before MinGW even existed. And, surprisingly, even MinGW
still has holes in 2014, where MsvcLibX in significantly more advanced.
Another alternative is CygWin. This one is more complete, but also much more
heavyweight. Using programs built with CygWin requires installing CygWin DLLs.
Copying the program .exe from one system to the next is not sufficient. In that
sense, MinGW or MsvcLibX are much better.
Contrary to MinGW and CygWin, MsvcLibX does not attempt to be complete, and is
unlikely to ever be. But any contribution of improvements is welcome.
Likewise, any help at contributing unique MsvcLibX features to MinGW is welcome.
Jean-François Larvoire
2016-09-29
Building the MsvcLibX library
-----------------------------
On a recent Windows PC, with Microsoft Visual C++ compilers installed:
- Select a base work directory. I'll call it %BASEDIR% in the examples below:
set "HOME=%HOMEDRIVE%%HOMEPATH%"
set "BASEDIR=%HOME%\Documents\SRC"
md "%BASEDIR%"
cd "%BASEDIR%"
- Extract the MsvcLibX archive into a work subdirectory. Ex: %BASEDIR%\MsvcLibX\
This will put files in several subdirectories: include, src
- Open a cmd window, and run:
cd "%BASEDIR%\MsvcLibX\src"
configure
make
The configure.bat script will locate your MSVC tools, and generate a config
file. It needs to be run once initially, then again if new MSVC tool versions
are installed.
The make.bat script should take care of everything, and rebuild normal and debug
versions of the MsvcLibX.lib library for all operating systems your tools support.
In the end, it defines system environment variable MSVCLIBX, necessary for
building programs using the MsvcLibX.lib library.
Requirements:
- Microsoft Visual C++ compiler and linker for Windows 32 and 64 bits targets.
- Microsoft Windows SDK. (May be installed along with Visual C++)
As of 2015-12-10, I've tested the make.bat script and make files with Visual C++
2005, 2008, 2012, and 2015, and Windows SDK 5.2, 8.1, and 10.
Support for older versions is still built-in, but I've not tested it for long.
Support for newer versions will require minor tweaks in configure.bat.
Note that configure.bat does not depend on MSVC's vcvars.bat. It will attempt
to locate and use the latest usable version of MSVC it finds in Program Files.
Optional:
- Microsoft Visual C++ 1.52 compiler and linker for MS-DOS targets.
If present in C:\MSVC, make.bat will also generate libraries for DOS.
Note that generating DOS versions is still more useful than it looks:
Experience has shown that the severe memory constraints under DOS are a very
good revelator of memory leaks, and other bad pointer issues. Build your
programs for DOS too if you can, and test them in a VM with Windows XP.
This takes a very small extra build time. And it'll be very much worth the time
if the Windows version appears to work, but the DOS version does not.
Visual C++ 1.52 is available on the Visual Studio 2005 CD.
- The Visual C++ 8 compiler and tools from Microsoft Visual Studio 2005.
This is the last version that allowed building programs for Windows 95/NT4.
The MsvcLibX.lib libraries are generated in subdirectories of src, then copied
into the %BASEDIR%\MsvcLibX\lib directory, and renamed as shown in this table:
Subdirectory | Description | Renamed as
---------------- | -------------------------------------- | ----------------
DOS\BIN\T\ | DOS normal version, tiny memory model | MsvcLibXdt.lib
DOS\DEBUG\BIN\T\ | DOS debug version, tiny memory model | MsvcLibXdtd.lib
DOS\BIN\S\ | DOS normal version, small memory model | MsvcLibXds.lib
DOS\DEBUG\BIN\S\ | DOS debug version, small memory model | MsvcLibXdsd.lib
DOS\BIN\L\ | DOS normal version, large memory model | MsvcLibXdl.lib
DOS\DEBUG\BIN\L\ | DOS debug version, large memory model | MsvcLibXdld.lib
WIN95\ | WIN32 normal version for Windows 95 | MsvcLibXw32.lib
WIN95\DEBUG\ | WIN32 debug version for Windows 95 | MsvcLibXw32d.lib
WIN32\ | WIN32 (X86) normal version | MsvcLibXw32.lib
WIN32\DEBUG\ | WIN32 (X86) debug version | MsvcLibXw32d.lib
WIN64\ | WIN64 (AMD64) normal version | MsvcLibXw64.lib
WIN64\DEBUG\ | WIN64 (AMD64) debug version | MsvcLibXw64d.lib
Building programs using the MsvcLibX library
--------------------------------------------
Create a work directory, distinct from the MsvcLibX directories. Ex:
set "HOME=%HOMEDRIVE%%HOMEPATH%"
set "BASEDIR=%HOME%\Documents\SRC"
md "%BASEDIR%\MyTools"
cd "%BASEDIR%\MyTools"
:# Define a variable giving the location of the MsvcLibX base directory
:# (Automatically defined if you built the library already on that same system.)
set "MSVCLIBX=%BASEDIR%\MsvcLibX"
:# Get batch files and make files from MsvcLibX sources
copy "%MSVCLIBX%\src\*.bat"
copy "%MSVCLIBX%\src\*.mak"
:# Create the configuration file (To be done just once)
configure
:# Compile and link your C or C++ program.
:# Ex, for the dirc.c sample, to create all dirc.exe versions, type:
make dirc.exe
:# If there is any error, the dirc.log file will pop up.
:# If there's no error, it's possible to check for warnings by reading dirc.log:
notepad dirc.log
:# All generated object files, listings, executables, etc, are in
:# target-OS-specific subdirectories, like for the MsvcLibX builds above.
:# They're automatically linked with the corresponding (renamed) MsvcLibX*.lib.
make.bat will generate WIN32 (X86) and WIN64 (AMD64) versions by default,
and put them respectively in the WIN32\ and WIN64\ subdirectories.
It will also generate a DOS version in DOS\ if MSVC 1.52 is installed.
It will also generate a WIN95 version in WIN95\ if MSVC 8 (aka. 2005) is installed.
Run `make -?` get a help screen for make.bat.
Note that the configure.bat and make.bat scripts are actually independent of the
rest of the MsvcLibX library. They can be used to easily build any console
programs for DOS and Windows, without loading the Visual Studio GUI.
An exe.bat script is a front-end to make.bat, saving a few characters to type:
`exe dirc` <==> `make dirc.exe`
Building Linux versions of the same programs
--------------------------------------------
Install virtual machines with Linux, and give them access to the host's file
system, for example in the /c directory.
Then execute the following commands, adapting the paths as needed:
# Go to the work directory
BASEDIR=/c/Users/YOURNAME/Documents/SRC
mkdir $BASEDIR/MyTools
cd $BASEDIR/MyTools
# Get a bash script to build Linux versions using similar directory outputs
cp $BASEDIR/MsvcLibX/src/exe .
# Make sure the Linux C compiler finds MsvcLibX debug macros, but not other MsvcLibX include files.
# Important: Do not point C_INCLUDE_PATH at MsvcLibX/include, as this directory
# contains duplicates for standard include files (Ex: stdio.h), that will fail
# to compile in Linux.
mkdir ~/include
cp $BASEDIR/MsvcLibX/include/debugm.h ~/include
export C_INCLUDE_PATH=~/include
# Make sure that variable is defined in all future sessions
echo "export C_INCLUDE_PATH=~/include" >>~/.bashrc
# Compile your sample dirc.c program (which uses MsvcLibX debug macros)
./exe dirc
# The output will be in subdirectories such as Linux.i686/ or Linux.x86_64/.
# (The exact name depends on `echo "$(uname -s).$(uname -m)"` output)
Adding new files to the library
-------------------------------
All new files should have headers and comments similar to the existing ones.
To add a new source file (let's call it newfile.c) into the library:
- Put newfile.c in the %MSVCLIBX%\src directory.
- Add a +newfile.obj entry to the OBJECTS list in %MSVCLIBX%\src\Files.mak
- Also add a rule with newfile.c include files dependencies in src\Files.mak.
- Rebuild the library, and make sure there are no errors nor warnings.
To add a new include file into the library:
- All new include file names should be standard C library include files names!
- Put it in the include or include\sys subdirectory.
To add an include file overriding an homonym one in the MSVC library:
- The trick is to make it include MSVC's one, then define its own extensions.
As MSVC compilers do not support the #include_next directive, I've implemented
a mechanism for including MSVC include files using their full pathname.
As an example, see include/direct.h or include/sys/stat.h.
The make file system
--------------------
Microsoft Visual Studio tools contain a build tool called nmake, very similar
to, but slightly incompatible with, Unix make.
MsvcLibX's make.bat is designed to give a similar feel to Unix make.
It uses internally a number of make files:
Make file | Description
----------- | ----------------------------------------------------------------
NMakefile | Default make file to use, if none is specified.
DOS.mak | Generic rules for building MS-DOS programs into the DOS subdir.
WIN32.mak | Generic rules for building 32-bits Windows programs into WIN32.
WIN64.mak | Generic rules for building 64-bits Windows programs into WIN64.
WIN95.mak | Generic rules for building Windows 95 programs into WIN95.
All.mak | Generic rules for building one or more of the above.
Files.mak | Application-specific source file dependancy rules. Intended to be includable from both Windows' nmakefile and Linux' makefile.
DOS.mak, WIN32.mak, WIN64.mak, and All.mak are pretty stable, and should not
be changed. The only likely case where a change is needed would be to add extra
libraries to link with _all_ programs.
To add a library for one particular program, it'd be better to add a specific
rule in its own make file, as described below.
In all cases, see the detailed notes in each make file header.
Specific make files:
To build a target called program.exe, the 5 make files with generic rules
(DOS.mak, WIN32.mak, WIN64.mak, WIN95.mak, and All.mak) first look for a
specific make file called program.mak. They include it if present. This allows
defining application-specific rules.
These rules should use macros defined in the 4 make files to specify the
build environment and parameters. Here's a list of the most useful ones:
Macro | Description
--------- | ----------------------------------------------------------------
T | Target OS. One of DOS, WIN32, WIN64, WIN95.
S | Path of the source files
O | Path where to put the object files
B | Path where to put the binary executable files
L | Path where to put the listings
CFLAGS | Flags for Microsoft C compiler
INCLUDE | List of C include file paths, serarated by ';'
LFLAGS | Flags for Microsoft linker
PROGRAM | The program base name, infered from the target name.
SOURCES | The list of sources for the program. Default: PROGRAM.c or .cpp
OBJECTS | The list of objects to link. Default: PROGRAM.obj
Scripts:
Script | Description
--------------------- | --------------------------------------------------------
make.bat | The main build tool. Invokes nmake.
config.%HOSTNAME%.bat | Defines paths to all tools used by make. Do not edit.
configure.bat | Analyses your system, and generates a config.%HOSTNAME%.bat file.
configure.*.bat | Define user or task-specific extensions to configure.bat.
exe.bat | Front end to make.bat, generating multiple goals.
exe | Linux shell script, invoking cc with multiple goals.
src2objs.bat | Internal script used by make files to convert SOURCES to OBJECTS
configure.bat with search for configure.*.bat scripts in %windir%, then in %HOME%,
then in the current directory.
Put configuration scripts with your global preferences in %windir% for example.
Within each directory, the files are called in the alphabetic order, allowing
to manage predictable dependancies.
Example 1: The 2clip program has no MS-DOS version. To prevent the make system
from attempting to build a DOS version (Only necessary if you DO have MSVC 1.52
installed), create a 2clip.mak file with this content:
!IF "$(T)"=="DOS"
complain:
@echo>con There's no DOS version of this program.
dirs $(O)\2clip.obj $(B)\2clip.exe: complain
@rem Do nothing
!ENDIF
Example 2: Porting to Windows a resize.c program manipulating jpeg images,
and using the libjpeg library. Create a resize.mak file with lines like these:
INCLUDE=$(INCLUDE);C:\JFL\SRC\Libs\libjpeg;C:\JFL\SRC\Libs\libjpeg\jpeg-8d
LFLAGS=$(LFLAGS) C:\JFL\SRC\Libs\libjpeg\$(B)\libjpeg.lib
Example 3: Some Windows programs need to include additional resources, defined
in a .rc file. Ex: The update program uses a manifest to control its rights.
Create an update.mak file with directives like this:
!IF "$(T)"=="WIN32" || "$(T)"=="WIN64"
SOURCES=update.c update.rc
LFLAGS=$(LFLAGS) /MANIFEST
!ENDIF
The debug system
----------------
The MsvcLibX library makes it easy to build two versions of each program:
- A release version, small lean and fast.
- A debug version, with additional code to help developers debug the program.
It follows Microsoft's convention of defining the macro _DEBUG when compiling
a C/C++ source for a debug build.
But it goes much further, by providing in debugm.h a set of macros to assist
debugging.
The general principle is that by default, the debug version operates exactly
like the release version. (Except possibly for performance)
Then, if the "debug mode" is enabled, it outputs debug messages on stdout.
A major property of the MsvcLibX debugging output is that is is intended by
function call depth. This makes it considerably easier to read the debug output.
The MsvcLibX library itself is built in debug and release versions.
The make.bat system will link the release version of your program with the
release version of the MsvcLibX library, and likewise for the debug versions.
To use it, include debugm.h in your main module, and add to your main() routine
a command-line option (-d or --debug maybe?) that calls DEBUG_ON().
There's also an "extra debug mode", displaying even more details than the
debug mode. It is enabled by calling DEBUG_ON() twice. ==> Invoke with -d -d.
Debug macros:
Macro | Description
--------------------------- | ------------------------------------------------
DEBUG_ON() | Enable the debug mode.
DEBUG_CODE(...) | The code within parentheses is only compiled in the debug version
DEBUG_PRINTF((format, ...)) | Generates a printf instruction in the debug version only, that prints only if debug mode is enabled, with the output indented by call depth.
DEBUG_ENTER((format, ...)) | Like DEBUG_PRINTF, but for use at the beginning of a function. Increases the indent level.
DEBUG_LEAVE((format, ...)) | Like DEBUG_PRINTF, but for use before returning from a function. Decreases the indent level.
Note that every use of DEBUG_ENTER must be matched by one DEBUG_LEAVE. So if a
function has several return instructions, every return must be preceded by a
DEBUG_LEAVE.
DEBUG_LEAVE alternatives:
To further simplify the source, a pair DEBUG_LEAVE()/return can be replaced by
one of the following macros:
Macro | Simplified description
----------------------------- | ------------------------------------------------
RETURN_INT(i) | DEBUG_LEAVE(("return %d\n", i)); return i;
RETURN_INT_COMMENT(i, (args)) | Idem, plus prints a comment behind the return
RETURN_BOOL(b) | DEBUG_LEAVE(("return %s\n", b?"TRUE":"FALSE")); return b;
RETURN_BOOL_COMMENT(b, (...)) | Idem, plus prints a comment behind the return
RETURN_CHAR(c) | DEBUG_LEAVE(("return %c\n", c)); return c;
RETURN_STRING(s) | DEBUG_LEAVE(("return %s\n", s)); return s;
For all the above, the release version just does return retValue;
Example for a recursive function factorial:
int fact(int n) {
DEBUG_ENTER((__FUNCTION__ "(%d);\n", n));
if (n) n *= fact(n-1); else n = 1;
RETURN_INT(n);
}
The debug version, in debug mode, invoked with argument 4, prints:
fact(4);
fact(3);
fact(2);
fact(1);
fact(0);
return 1;
return 1;
return 2;
return 6;
return 24;
Support for UTF-8 sources
-------------------------
The MsvcLibX library supports writing C programs using 8-bit characters,
with strings encoded as UTF-8, and that will work for any cmd.exe code page.
This makes the sources much more simple and readable that using full-fledged
Unicode, with 16-bits wchar_t or WCHAR and L"strings" or _T("strings").
Note: The cmd.exe code page can be read and changed with the CHCP command.
The most common code pages are:
CP | Description
----- | ----------------------------------------------------------------------------
437 | MS-DOS OEM code page, still used by cmd.exe in US and west-European systems.
1252 | Windows "ANSI" code page, used by most GUI programs, like notepad.exe.
65001 | UTF-8 code page. Allows display any Unicode character.
Important: Changing the code page will only work correctly if cmd.exe is using
a TrueType font. The default "Raster" font supports code page 437 only.
To enable that UTF-8 support:
1. Set the C or C++ source encoding to UTF-8 with BOM. (BOM = Byte-Order Mark)
Having a BOM is important, as without it some Windows editors will incorrectly
detect the encoding, and then sometimes corrupt the source.
2. Define one of the following constants in the .c source, _before_ including
any .h include files:
#define _BSD_SOURCE 1 /* Defined by many standard BSD-Unix programs */
#define _GNU_SOURCE 1 /* Defined by many standard GNU-Unix/Linux programs */
#define _UTF8_SOURCE 1 /* MsvcLibX-specific */
Note that most modern Linux compilers do expect C sources encoded as UTF-8,
and will silently ignore the UTF-8 BOM if present.
Internally, MsvcLibX extends Microsoft's convention of having two ANSI and Wide
versions of each routine, respectively with an 'A' and a 'W' suffix. Ex:
FindFirstFile() being an alias to either FindFirstFileA() or FindFirstFileW().
MsvcLibX uses two additional suffixes: 'U' for the UTF-8 version, and 'M' for
the common MultiByte subroutine used by both the 'A' and 'U' versions. Ex:
Function | Description
---------- | ---------------------------------------------------------------
readlinkW | Posix routine readlink - Wide char version
readlinkM | MultiByte char sub-routine, used by the next two routines.
readlinkA | Posix routine readlink - ANSI version
readlinkU | Posix routine readlink - UTF-8 version
readlink | Posix routine readlink - Alias to either readlinkA or readlinkU
Note that the M version has one additional argument: The code page to use for
converting strings to and from Unicode. In that sense, it's not Posix-compliant.
Gotcha: As of 2014-03-25, most file I/O and enumeration routines have been
restructured this way, but a few have not yet been:
scandir() and lstat() only support UTF-8 file names, not ANSI names.
Gotcha: As of 2014-03-25, there's a potential issue with the C main() routine:
Supporting UTF-8 file names is not just supporting UTF-8 strings in library
functions. It's also necessary to process the command line, so that command line
arguments are passed in to the main() routine as UTF-8 strings.
Currently this is implemented as a macro that redefines the main token, so
that it generates a main() routine just calling a _mainU0() routine from
MsvcLibX.lib, followed by another local _mainU() routine with the body intended
for your main routine. Ex:
int main(int argc, char *argv[]) { /* your main body */ }
Becomes:
int main(int argc, char *argv[]) {return _mainU0()}
int _mainU(int argc, char *argv[]) { /* your main body */ }
The _mainU0() routine from MsvcLibX.lib reprocesses the Win32 command line as
UTF-8 argv[] arguments, then calls _mainU(argc, argv[]).
This works well and transparently, except in one case:
If one of your sources or include files contain a prototype for the main()
routine, then MsvcLibX' main macro will break that prototype, and cause
compilation and/or link errors.
If this happens, simply remove the main() prototype, which is useless anyway.
Support for NTFS symlinks and junctions
---------------------------------------
Posix defines only a single kind of symbolic links, usable for any kind of
targets, whether they're files, directories, or further symbolic links.
The standard C library defines functions for managing symbolic links:
Function | Description
---------- | ----------------------------------------------------------------
readlink() | Read a link target
symlink() | Create a link, or change its target
lstat() | Read the metadata (timestamp, access rights) for the link itself
lchmod() | Change the link access rights
lchown() | Change the link owner
realpath() | Generate an absolute path, with all links resolved
Windows defines three types of links:
Type | Description
--------- | ---------------------------------------------------------------
SYMLINK | Symbolic link to a file
SYMLINKD | Symbolic link to a directory
JUNCTION | Mount point, often used as a symbolic link to another directory
All three types can be created in Vista and later by the mklink command.
JUNCTIONS can also be created in 2000 and later by Microsoft's SysInternal's
junction command.
One important difference is that JUNCTIONs can be created with normal user
rights, whereas SYMLINKs and SYMLINKDs require administrator rights in an
elevated command window.
A second important difference is that on networks, SYMLINKs and SYMLINKDs are
interpreted on the client side, whereas JUNCTIONs are interpreted on the server
side (despite having their target readable from the client side).
The MsvcLibcX library tries to hide that complexity, and implements the standard
functions as if there were only one kind of link.
It also provides non-standard functions symlinkd() and junction() to
specifically create SYMLINKDs and JUNCTIONs respectively.
Notes about readlink():
For SYMLINKs and SYMLINKDs, the case is straightforward.
For JUNCTIONs, there are two problems:
- The target is stored as an absolute path, even when the JUNCTION was created
with a relative path. readlink() tries to convert the absolute path to a
relative path, so that file copying utilities can clone trees with internal
JUNCTIONs.
- When the JUNCTION is on a network drive, the target refers to the absolute
path on the server. This may not be accessible from the client through the
existing mounted shares. Even when this is accessible, it's not always easy
to map the server path to a valid client path.
readlink() uses heuristics which always work for drives shared at the drive
level. Ex: a C: drive shared as C$, a D: drive shared as D$, etc.
The heuristic also very likely works for drives shared at the root or first
directory level. Ex: C:\ shared as CROOT, or C:\Public shared as PUBLIC.
As of 2014-03-25, it'll fail in any other case. Ex:
C:\Users\YOURNAME shared as YOURHOME,
or a C:\Public share mounted through its subdirectory C:\Public\Temp
Notes about symlink():
symlink() will attempt to create a SYMLINK or a SYMLINKD, depending on the type
of the target. This works well when the target exists. But when it does not
(which is legal), it will create a SYMLINK by default, or a SYMLINKD if the
target ends with a '/' or a '\'. Posix allows, but does not require, providing
a trailing '/', so the link type may possibly be incorrect.
junction() will have the same issues as readlink() above.
Notes about junction():
The problem for junction() is to convert a client-side target pathname provided
by the program running on the client, to a server-side pathname, necessary for
junctions to work.
For full-drive shares (i.e. any share named like D$), this is easy.
For non-full-drive shares (i.e. anything else), it will assume this is a
first level shared directory on the C: drive. Ex: A link on share PUBLIC
will be targeted at C:\PUBLIC.
Problem: The junction will not work if the share actually resides anywhere else
on the server. But, surprisingly, there's an easy workaround:
Simply create manually on the server itself, a junction called C:\PUBLIC,
pointing at the actual directory shared as PUBLIC.
This way the junctions created from the client side will work correctly, both
on the client and on the server side, after being resolved on the server side
through that second junction.
Support for Windows 95/98
-------------------------
The configure.bat script searches for old versions of the Visual C++ compiler,
which can build WIN32 programs that can run in Windows 95/98/ME/NT4.
The most recent of these is Visual C++ 8, from Visual Studio 2005.
The make.bat script can then use rules in win95.mak to builds WIN32 programs
that will run in any version of Windows from Windown 95 to Windows 10.
Note however that Windows 95/98/ME only have a very limited support for Unicode
built in. The rest of this section mentions 95, but applies to 98 & ME as well.
The MsvcLibX library uses a number of Unicode functions not available in default
installations of Windows 95. This includes all file management functions.
Thus most of our WIN95 executables will not work by default in Windows 95.
To allow them to work, it is necessary to download from Microsoft a "Microsoft
Layer for Unicode on Windows 95/98/ME Systems" (MSLU for short), and install it
on the Windows 95 system. See the following links for details:
https://en.wikipedia.org/wiki/Microsoft_Layer_for_Unicode
https://msdn.microsoft.com/en-us/goglobal/bb688166.aspx
MSLU installation procedure:
- Download the MSLU redistributable setup (unicows.exe) from:
http://go.microsoft.com/fwlink/?LinkId=14851
- Extract unicows.dll from the unicows.exe archive.
- Copy that unicows.dll to the Windows 95 system, into %windir%\System.
Testing WIN95 executables in a Windows 95 VM
VMWare Player does not have Windows 95 drivers for the HGFS file system.
This prevents accessing the host's files directly as network files, as is
usually done for Windows XP and later versions of Windows.
It is not possible to use network shares either, as Windows 95 only supports
the SMB 1 protocol, which is actively blocked by Windows Vista and later hosts.
It is possible, but inconvenient, to transit through a web server, and download
the files in the Windows 95 VM using Internet Explorer 4.
The best solution probably is to transit through a floppy or CD image, and
mount that image in the VM Player. Many tools, including our own HpMkIso.exe
can create CD images. A very convenient shareware called WinImage allows to
create floppy images.
Another solution is to install a Web server on the host PC, and use Internet
Explorer 4 in Windows 95 to download the executable files into the VM.
Support for DOS, and bound DOS+Windows programs
-----------------------------------------------
- If Visual C++ 1.52 is installed, configure.bat will setup the make system
for building the MS-DOS version of your programs. (Output in the DOS directory)
- If Visual C++ 8 is installed, configure.bat will setup the make system
for building 32-bits versions of your programs compatible with Windows 95
and all later versions, including 64-bits ones. (Output in the WIN95 directory)
Both are available as part of the Visual Studio 2005 CD, still available for
download for MSDN subscribers from the MSDN web site.
Win32 programs have an "MS-DOS stub", that runs when the Windows program is
executed under MS-DOS.
The default stub used by the Win32 linker if a tiny DOS program that displays
an error message such as: "This program can only run in Windows"
When it builds the WIN95 or WIN32 version of a program, and when it has built
the DOS version already, the MsvcLibX make system uses that DOS version as the
stub for the Windows version.
This allows building executables that work in *all* versions of DOS and Windows!
- When run in MS-DOS, it's the DOS stub of the exe that runs.
- When run in Windows (even 64-bits versions), it's the Win32 part that runs.
Note that the make system will build such bound executables for any WIN32
build made with more recent compilers. But these recent compilers generate
executables that cannot run in old versions of Windows. For example, the
Visual C++ 14 compiler can only target Windows Vista and later systems.
Having an executable that can run in DOS and Windows 7, but not in Windows XP,
is not very useful. Make sure to install the Visual C++ 8 compiler in parallel
with Visual C++ 1.52, and the latest compiler (Visual C++ 14 at the time of
this writing), to generate truly universal WIN95 builds, that run in
DOS/95/98/ME/2000/XP/Vista/7/8/10.
History
-------
**1986**
I (Jean-François Larvoire) started writing command-line tools for MS-DOS.
Some were enumerating files, using inline assembly language to make MS-DOS
interrupt 21h system calls: update, dirsize, redo, backnum, which, dirc...
To make it simple I factored these out in subroutines srch1st and srchnext,
that I manually copied from one program to the next.
Things got a bit tricky to support recursion, which was not straightforward
in MS-DOS.
**1992**
We got an OS/2 server, and I started porting the above programs to OS/2.
MS-DOS was still important, so I used conditional compilation to support
both operating systems with the same source.
I wrote a second version of srch1st and srchnext for OS/2, and had to
include a new routine srchdone due to OS/2 API constraints.
dirc was the first program I ported, then I slowly duplicated the code into
the other programs. Synchronizing bug fixes became more difficult.
A nice trick was the OS/2 supported dual-mode EXEs, with both the DOS and
OS/2 version bound in the same .exe file.
**1995**
We ditched the OS/2 server, and got a new one running Windows NT.
Again, I created a third conditionally compiled version of srch1st/srchnext/
srchdone for WIN32, for use in dirc.
Manually back porting the updates and bug fixes to all programs became
really painful, and took several years.
Like OS/2, Windows supported dual-mode EXEs, and I updated my make files
to include both the DOS and Windows version in the same file.
**2005**
I started working on Linux projects. Despite the bonanza of command-line
tools available, I couldn't find one equivalent to dirc.
So, yet another time, I created a fourth conditionally compiled version of
srch1st/srchnext/srchdone for Linux, and obtained a Linux version of dirc.
I also ported it and a couple of other programs to Tru64, which was the
first 64-bits OS I worked with. This exposed a few unsuspected bugs.
The thing became so complex than porting the changes and updates to the
other programs was a nightmare. I did it for a few of them, but never
got the time to port them all.
**2010**
Building WIN64 versions was relatively easier due to the Tru64 precedent,
but added yet another set of conditional compilations.
The porting nightmare worsened.
**2012**
I tried porting some unrelated Linux programs to Windows, and hit a wall:
Many include files and standard C library routines were missing in MSVC.
I then tried using MinGW, but it too was missing many required features!
I considered contributing updates to MinGW, but that project was too
complex and ill-documented at that time, and I eventually gave up.
Instead, I started writing my own "libc-ext" library of include files and
routines to supplement MSVC.
Ex: stdint.h, inttypes.h, fnmatch.h/fnmatch.c, ...
Also it became obvious that multiplying conditional compilations and
duplicating directory access code everywhere was wrong. Instead I had to
write standard dirent.h/dirent.c routines for DOS/OS2/Windows, and
rewrite all my programs around these standard routines.
I did it for DOS and Windows versions, and left stubs of the OS/2 versions,
for the unlikely case where somebody wants to revive them.
**2013**
The restructuration was over for dirc, dirsize, which, backnum, update.
The library got its final name, "MsvcLibX", to better match it purpose:
An extension of the Microsoft Visual C library, not of the standard libc.
As the library grew, debugging it became more difficult, and I decided to
use my debugm.h within the library: This file contains a set of debugging
macros I had developed for other programs.
I started thinking about sorely needed improvements:
- There was no support for Windows symlinks and junctions.
- The Windows versions of the programs output ANSI file names into a
cmd.exe window using the OEM character set. This caused all files with
French names to be shown as garbage.
- Worse still, I had a few files and directories with non-ANSI names
(In Russian and Chinese), that caused the programs to fail!
The Linux version of the program did not have these issues, as all recent
versions of Linux use the UTF-8 encoding, and this works transparently
even for old programs using 8-bits characters like mine.
**2014**
I got a bit more time, and started working on a redesign of MsvcLibX's
dirent.c/dirent.h, and added lstat.c, symlink.c, readlink.c, etc, to
support symlinks, junctions, and UTF-8 file names.
This proved to be much more work than I initially thought, but the result
was worth the effort: dirc, update got easily adapted, with remarkably
few changes to their source. Adding recursion to update was easy.
I'm now able to use update to backup all files on my system, including
symbolic links, and junctions used as poor man's links. And the programs
now display names correctly in any code page with the right font.
A seventh program, truename, joined the collection using dirent.h routines.
Later in the year, I made significant other changes:
- Split make.bat into a generic make.bat/configure.bat pair of scripts.
configure.bat needs to be run once, plus everytime the environment
changes. (Such as if a new MSVC version is installed.)
Project-specific definitions are moved to new files, such as our
configure.MsvcLibX.bat.
- Added a general mechanism for defining extensions to existing MSVC
include files. This allowed defining our own homonym include files,
containing just the missing definitions. Which in turn allowed to move
many such definitions, that were initially stored in unistd.h for lack
of an alternative, to their standard location.
- Updated all file functions to support WIN32 pathnames > 260 characters.
(The basic WIN32 functions that I used until then had that limitation;
I'm now using extended functions supporting path lengths up to 64K.)
All tools like dirc, dirsize, which, backnum, update, truename, redo
benefit from that last change.
**2015**
A major improvement was the addition of support for new operating systems
and processor targets. This required redesigning several things:
The OS-specific definition macros have been renamed to more generic names.
The DosWin.mak file has been replaced by a more generic All.mak,
supporting the old dos.mak, win32.mak, and win64.mak, plus the new...
- bios.mak Allows building 16-bits programs that can run in BIOS option
ROMs. These programs are based on the BiosLib library,
documented separately.
- win95.mak Allows building win32 programs that run in Windows 95.
- ia64.mak Allows building 64-bits programs that run in IA64 versions
of Windows. Not tested.
- arm.mak Allows building win32 programs for Windows RT.
Tests failed so far, due to a missing "ARM Desktop SDK".
All.mak also skips building versions for which no tools are available;
This prevents problems in the normal case when people only have the latest
version of MSVC. In this case, it just builds the WIN32 and WIN64 versions.
The support for Windows 95 required fixing numerous issues with old
Microsoft tools and Windows SDKs.
Conversely, the support for Visual Studio 15 also required fixing lots of
issues, as the MSVC library has been completely redesigned, and split into
two parts:
- A compiler-specific part, part of the compiler tree as before.
- A generic part, called Universal C runtime (UCRT) that's now part of
the windows SDK.
And of course there were also issues with MsvcLibX recent improvements,
like Unicode support and symlink support, which had never been tested,
and of course did not work, in Windows 95 and XP.
**2016**
Many significant changes and improvements this year:
- Changed the UTF-8 C source support to require a UTF-8 BOM.
This is to prevent problems with Windows tools that tend to corrupt files
without a UTF-8 BOM, but with other UTF-8 characters.
This required changing all C/C++ compilation rules to first remove the
UTF-8 BOM, as MS compilers do not react correctly when they find one.
- Added a windows.h extension.
Just like Standard C library APIs, windows 8-bit APIs can be overriden to
refer to custom routines that support UTF-8 strings.
The MsvcLibX library was beginning to use a significant number of these
custom routines internally. They're now accessible directly to outside
UTF-8 programs targeting only Windows.
- Finished implementing support for the OUTDIR variable. (Started in 2015.)
All make files now optionally create output files in an %OUTDIR% directory.
This is intended for testing builds in VMs, with shared sources on the
host, but the output locally in the VM, avoiding to overwrite the main
version on the host. IF %OUTDIR% is not defined, the default output
still goes below the source directory as before.

View File

@ -1,146 +0,0 @@
:# config.DESKTOP-U79TD6T.bat generated by configure.bat on 2020/05/19 Öܶþ 7:49:05.47
:#
:# If changes are needeed, do not edit this file, but instead create a new script
:# called configure.YOURCHOICE.bat. This new script will be invoked automatically
:# by configure.bat while creating this file. Then your script can write extra
:# definitions, or change some of the variables before configure.bat writes them.
:#
:# Invoke configure.bat manually if anything changes in the tools config, such as
:# installing a Visual Studio update, or updating a configure.XXX.bat script.
set "HAS_STINCLUDE=1" &:# Found the System Tools global C includes
set "STINCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# System Tools global C includes
set "HAS_SDK_FLAGS=/DHAS_STINCLUDE=1" &:# SDK detection flags for the C compiler
SET "PF32=C:\Program Files (x86)" &:# 32-bits Program Files
SET "PF64=C:\Program Files" &:# 64-bits Program Files
SET "ARCH=AMD64" &:# PROCESSOR_ARCHITECTURE
SET "MASM=" &:# Microsoft 16-bits Assembler base path
SET "MSVC=" &:# Microsoft 16-bits Visual C++ base path
SET "MAPSYM=" &:# 16-bits debugging symbols generator
SET "VSTUDIOLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0" &:# Microsoft Visual Studio (Long path)
SET "VSTUDIO=C:\PROGRA~2\MICROS~2.0" &:# Microsoft Visual Studio (Short path)
SET "VSCOMMONLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7" &:# Microsoft Visual Studio Common Files (Long path)
SET "VSCOMMON=C:\PROGRA~2\MICROS~2.0\Common7" &:# Microsoft Visual Studio Common Files (Short path)
SET "VSIDELONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Long path)
SET "VSIDE=C:\PROGRA~2\MICROS~2.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Short path)
SET "VSTOOLSLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Long paths)
SET "VSTOOLS=C:\PROGRA~2\MICROS~2.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Short paths)
SET "MSVC32LONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" &:# Microsoft Visual C++ 32/64 bits (Long path)
SET "MSVC32=C:\PROGRA~2\MICROS~2.0\VC" &:# Microsoft Visual C++ 32/64 bits (Short path)
SET "WIN_CP=936" &:# Windows Code Page
SET "WIN_CS=gb2312" &:# Windows Character Set
SET "DOS_CP=936" &:# DOS Code Page
SET "DOS_CS=gb2312" &:# DOS Character Set
SET "AS=" &:# Assembler
SET "CC=" &:# C compiler
SET "INCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# Include paths. Define USER_INCLUDE if needed.
SET "LK=" &:# Linker
SET "LIB=" &:# Libraries paths. Define USER_LIBS if needed.
SET "LB=" &:# Library manager
SET "RC=" &:# Resource compiler
SET "MT=" &:# Manifest tool
SET "DOS_CC=" &:# Microsoft Visual C++ 16-bits compiler
SET "DOS_AS=" &:# Microsoft 16-bits assembler
SET "DOS_LK=" &:# Microsoft 16-bits linker
SET "DOS_LB=" &:# Microsoft 16-bits librarian
SET "DOS_RC=" &:# Microsoft 16-bits resource compiler
SET "DOS_MT=" &:# Microsoft 16-bits manifest tool
SET "DOS_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 16-bits compilation
SET "DOS_VCINC=" &:# Visual C++ 16-bits compiler include dir for MsvcLibX include_next
SET "DOS_CRTINC=" &:# Visual C++ 16-bits CRT library include dir for MsvcLibX include_next
SET "DOS_INCPATH=" &:# Include paths for 16-bits compilation
SET "DOS_LIBPATH=" &:# Libraries paths for 16-bits linking
SET "DOS_WINSDK=" &:# Microsoft Windows 16-bits SDK
SET "DOS_WINSDKINC=" &:# Microsoft Windows 16-bits SDK Include directory
SET "WIN95_CC=" &:# Microsoft Visual C++ 32-bits compiler
SET "WIN95_AS=" &:# Microsoft 32-bits assembler
SET "WIN95_LK=" &:# Microsoft 32-bits linker
SET "WIN95_LB=" &:# Microsoft 32-bits librarian
SET "WIN95_RC=" &:# Microsoft 32-bits resource compiler
SET "WIN95_MT=" &:# Microsoft 32-bits manifest tool
SET "WIN95_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation
SET "WIN95_VCINC=" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next
SET "WIN95_CRTINC=" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next
SET "WIN95_INCPATH=" &:# Include paths for 32-bits compilation
SET "WIN95_LIBPATH=" &:# Libraries paths for 32-bits linking
SET "WIN95_WINSDK=" &:# Microsoft Windows 32-bits SDK
SET "WIN95_WINSDKINC=" &:# Microsoft Windows 32-bits SDK Include directory
SET "WIN32_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.EXE"" &:# Microsoft Visual C++ 32-bits compiler
SET "WIN32_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ML.EXE"" &:# Microsoft 32-bits assembler
SET "WIN32_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LINK.EXE"" &:# Microsoft 32-bits linker
SET "WIN32_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LIB.EXE"" &:# Microsoft 32-bits librarian
SET "WIN32_RC=" &:# Microsoft 32-bits resource compiler
SET "WIN32_MT=" &:# Microsoft 32-bits manifest tool
SET "WIN32_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation
SET "WIN32_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next
SET "WIN32_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next
SET "WIN32_INCPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 32-bits compilation
SET "WIN32_LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86" &:# Libraries paths for 32-bits linking
SET "WIN32_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 32-bits SDK
SET "WIN32_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 32-bits SDK Include directory
SET "IA64_CC=" &:# Microsoft Visual C++ IA64 compiler
SET "IA64_AS=" &:# Microsoft IA64 assembler
SET "IA64_LK=" &:# Microsoft IA64 linker
SET "IA64_LB=" &:# Microsoft IA64 librarian
SET "IA64_RC=" &:# Microsoft IA64 resource compiler
SET "IA64_MT=" &:# Microsoft IA64 manifest tool
SET "IA64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for IA64 compilation
SET "IA64_VCINC=" &:# Visual C++ IA64 compiler include dir for MsvcLibX include_next
SET "IA64_CRTINC=" &:# Visual C++ IA64 CRT library include dir for MsvcLibX include_next
SET "IA64_INCPATH=" &:# Include paths for IA64 compilation
SET "IA64_LIBPATH=" &:# Libraries paths for IA64 linking
SET "IA64_WINSDK=" &:# Microsoft Windows IA64 SDK
SET "IA64_WINSDKINC=" &:# Microsoft Windows IA64 SDK Include directory
SET "WIN64_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\CL.EXE"" &:# Microsoft Visual C++ 64-bits compiler
SET "WIN64_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ML64.EXE"" &:# Microsoft 64-bits assembler
SET "WIN64_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LINK.EXE"" &:# Microsoft 64-bits linker
SET "WIN64_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LIB.EXE"" &:# Microsoft 64-bits librarian
SET "WIN64_RC=" &:# Microsoft 64-bits resource compiler
SET "WIN64_MT=" &:# Microsoft 64-bits manifest tool
SET "WIN64_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 64-bits compilation
SET "WIN64_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 64-bits compiler include dir for MsvcLibX include_next
SET "WIN64_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 64-bits CRT library include dir for MsvcLibX include_next
SET "WIN64_INCPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 64-bits compilation
SET "WIN64_LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" &:# Libraries paths for 64-bits linking
SET "WIN64_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 64-bits SDK
SET "WIN64_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 64-bits SDK Include directory
SET "ARM_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\CL.EXE"" &:# Microsoft Visual C++ ARM compiler
SET "ARM_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\ARMASM.EXE"" &:# Microsoft ARM assembler
SET "ARM_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LINK.EXE"" &:# Microsoft ARM linker
SET "ARM_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LIB.EXE"" &:# Microsoft ARM librarian
SET "ARM_RC=" &:# Microsoft ARM resource compiler
SET "ARM_MT=" &:# Microsoft ARM manifest tool
SET "ARM_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM compilation
SET "ARM_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ ARM compiler include dir for MsvcLibX include_next
SET "ARM_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ ARM CRT library include dir for MsvcLibX include_next
SET "ARM_INCPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for ARM compilation
SET "ARM_LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm" &:# Libraries paths for ARM linking
SET "ARM_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows ARM SDK
SET "ARM_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows ARM SDK Include directory
SET "ARM64_CC=" &:# Microsoft Visual C++ ARM64 compiler
SET "ARM64_AS=" &:# Microsoft ARM64 assembler
SET "ARM64_LK=" &:# Microsoft ARM64 linker
SET "ARM64_LB=" &:# Microsoft ARM64 librarian
SET "ARM64_RC=" &:# Microsoft ARM64 resource compiler
SET "ARM64_MT=" &:# Microsoft ARM64 manifest tool
SET "ARM64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM64 compilation
SET "ARM64_VCINC=" &:# Visual C++ ARM64 compiler include dir for MsvcLibX include_next
SET "ARM64_CRTINC=" &:# Visual C++ ARM64 CRT library include dir for MsvcLibX include_next
SET "ARM64_INCPATH=" &:# Include paths for ARM64 compilation
SET "ARM64_LIBPATH=" &:# Libraries paths for ARM64 linking
SET "ARM64_WINSDK=" &:# Microsoft Windows ARM64 SDK
SET "ARM64_WINSDKINC=" &:# Microsoft Windows ARM64 SDK Include directory
exit /b 0 &:# Configuration done successfully

View File

@ -1,35 +0,0 @@
@echo off
:#*****************************************************************************
:# *
:# Filename: configure.bat *
:# *
:# Description: Detect system-specific settings and create config.*.bat *
:# *
:# Notes: Proxy script for %STINCLUDE%\configure.bat. *
:# *
:# Make any change needed in %STINCLUDE%\configure.bat. *
:# *
:# History: *
:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. *
:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. *
:# *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:#*****************************************************************************
:# Get the full pathname of the STINCLUDE library directory
if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides
for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above.
for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d"
)
if not defined STINCLUDE ( :# Try getting the copy in the master environment
for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v"
)
if not exist %STINCLUDE%\make.bat (
>&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE.
exit /b 1
)
if [%1]==[-d] echo "%STINCLUDE%\configure.bat" %*
"%STINCLUDE%\configure.bat" %*

View File

@ -19,7 +19,7 @@
#include "msvclibx.h"
#include UCRT_INCLUDE_FILE(direct.h) /* Include MSVC's own <direct.h> file */
#include <direct.h> /* Include MSVC's own <direct.h> file */
#undef mkdir /* This MSVC macro is incompatible with mkdir() function in unistd.h */

View File

@ -18,7 +18,7 @@
#include "msvclibx.h"
#include UCRT_INCLUDE_FILE(fcntl.h) /* Include MSVC's own <fcntl.h> file */
#include <fcntl.h> /* Include MSVC's own <fcntl.h> file */
/* Microsoft defines _open() in io.h */
#include <io.h>

View File

@ -18,7 +18,7 @@
#include "msvclibx.h"
#include MSVC_INCLUDE_FILE(limits.h) /* Include MSVC's own <limits.h> file */
#include <limits.h> /* Include MSVC's own <limits.h> file */
/************************ MS-DOS-specific definitions ************************/

View File

@ -19,7 +19,7 @@
#include "msvclibx.h"
#include UCRT_INCLUDE_FILE(process.h) /* Include MSVC's own <process.h> file */
#include <process.h> /* Include MSVC's own <process.h> file */
#if defined(_WIN32)
extern intptr_t _spawnvpU(int iMode, const char *pszCommand, char *const *argv);

View File

@ -20,7 +20,7 @@
#include "msvclibx.h"
#include UCRT_INCLUDE_FILE(stdio.h) /* Include MSVC's own <stdio.h> file */
#include <stdio.h> /* Include MSVC's own <stdio.h> file */
#include <sys/types.h>

View File

@ -18,7 +18,7 @@
#include "msvclibx.h"
#include UCRT_INCLUDE_FILE(stdlib.h) /* Include MSVC's own <stdlib.h> file */
#include <stdlib.h> /* Include MSVC's own <stdlib.h> file */
#ifdef __cplusplus
extern "C" {

View File

@ -19,8 +19,8 @@
#include "msvclibx.h"
#include WINSDK_INCLUDE_FILE(winsock2.h)
#include UCRT_INCLUDE_FILE(time.h) /* Include MSVC's own <time.h> file */
#include <winsock2.h>
#include <time.h> /* Include MSVC's own <time.h> file */
#ifdef _MSDOS
@ -33,7 +33,7 @@
#ifdef _WIN32
#include "sys\time.h" /* for struct timespec */
#include "sys\msvcTime.h" /* for struct timespec */
typedef int clockid_t;
/* Supported values for clockid_t */

View File

@ -30,8 +30,8 @@
#endif
#include "msvclibx.h" /* Generate a library search record to load MsvcLibX.lib. */
#include "sys/types.h" /* Define pid_t and getppid(). */
#include "dirent.h" /* Define pid_t and getppid(). */
#include "sys/msvcTypes.h" /* Define pid_t and getppid(). */
#include "msvcDirent.h" /* Define pid_t and getppid(). */
#include <direct.h> /* For functions like _chdir() and _getcwd() */
#include <process.h> /* For _getpid() */

View File

@ -20,7 +20,7 @@
#ifdef _WIN32
#include WINSDK_INCLUDE_FILE(windows.h) /* Include Windows SDK's own windows.h */
#include <windows.h> /* Include Windows SDK's own windows.h */
/****************** Define UTF-8 versions of WIN32 routines ******************/

View File

@ -1,17 +0,0 @@
/*****************************************************************************\
* *
* Filename: stdio--.h *
* *
* Description: front-end to stdio.h that redefines some unsafe functions *
* *
* Notes: This header is part of the GNU CoreUtils library. *
* msvclibx: Pass through to the standard stdio.h. *
* *
* History: *
* 2012-10-17 JFL Created this file. *
* *
* Copyright 2016 Hewlett Packard Enterprise Development LP *
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#include <stdio.h>

View File

@ -28,11 +28,11 @@
#include "msvclibx.h"
#include <sys/types.h>
#include UCRT_INCLUDE_FILE(sys\stat.h) /* Include MSVC's own <sys/stat.h> file */
#include <dirent.h> /* For dirent2stat() arguments definitions */
#include <time.h> /* for time_t definition */
#include <sys/time.h> /* for timespec definition */
#include "sys/msvcTypes.h"
#include <sys/stat.h> /* Include MSVC's own <sys/stat.h> file */
#include "msvcDirent.h" /* For dirent2stat() arguments definitions */
#include "msvcTime.h" /* for time_t definition */
#include "sys/msvcTime.h" /* for timespec definition */
/* Include MsvcLibX's <direct.h> override, to avoid conflict with the standard mkdir defined here,
should <direct.h> be manually included later on in the C source */
#include <direct.h>
@ -154,7 +154,7 @@ extern char *Filetime2String(uint16_t date, uint16_t time, char *pBuf, size_t nB
if we were to use MsvcLibX extended stat structures and routines */
#define _LIBX_stat _CONCAT(_MSVC_stat,_ns)
#define _LIBX_stat64 _CONCAT(_MSVC_stat64,_ns)
#include "debugm.h"
#include "msvcDebugm.h"
#pragma message("Defining type struct " VALUEIZE(_LIBX_stat))
struct _LIBX_stat {
/* MSVC standard stat structure fields */

View File

@ -20,7 +20,7 @@
#include "msvclibx.h"
#include UCRT_INCLUDE_FILE(sys\types.h) /* Include MSVC's own <sys/types.h> file */
#include <sys\types.h> /* Include MSVC's own <sys/types.h> file */
/************************ MS-DOS-specific definitions ************************/
@ -90,6 +90,7 @@ typedef int uid_t;
/* MsvcLibX uses mode_t in sys/stat.h */
typedef int mode_t;
#define HAVE_MODE_T
/* File link counts type (not used by MsvcLibX so far) */
typedef int nlink_t; /* Is short in some Unix versions */

View File

@ -1,35 +0,0 @@
@echo off
:#*****************************************************************************
:# *
:# Filename: make.bat *
:# *
:# Description: Build DOS and Windows targets *
:# *
:# Notes: Proxy script for %STINCLUDE%\make.bat. *
:# *
:# If any change is needed, put it in %STINCLUDE%\make.bat. *
:# *
:# History: *
:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. *
:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. *
:# *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:#*****************************************************************************
:# Get the full pathname of the STINCLUDE library directory
if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides
for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above.
for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d"
)
if not defined STINCLUDE ( :# Try getting the copy in the master environment
for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v"
)
if not exist %STINCLUDE%\make.bat (
>&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE.
exit /b 1
)
if [%1]==[-d] echo "%STINCLUDE%\make.bat" %*
"%STINCLUDE%\make.bat" %*

View File

@ -1,261 +0,0 @@
###############################################################################
# #
# File name Files.mak #
# #
# Description MsvcLibX Specific file dependancies #
# #
# Notes #
# #
# History #
# 2012-10-21 JFL Initial version #
# 2013-03-27 JFL Added debugv.obj and getppid.obj. #
# 2014-02-03 JFL Added readlink.obj. #
# 2014-02-05 JFL Added symlink.obj. #
# 2014-02-06 JFL Added lstat*.obj. #
# 2014-02-10 JFL Added realpath.obj. #
# 2014-02-17 JFL Added err2errno.obj. #
# 2014-02-26 JFL Added filetime.obj. #
# 2014-02-27 JFL Added iconv.obj. #
# 2014-02-28 JFL Added chdir.obj and getcwd.obj. #
# 2014-03-04 JFL Added fopen.obj. #
# 2014-03-06 JFL Added strerror.obj. #
# 2014-03-24 JFL Added access.obj. #
# 2014-03-27 JFL Added spawn.obj. #
# 2014-05-30 JFL Moved here the OBJECTS macro definition from NMakeFile. #
# Added uname.obj and utimes.obj. #
# 2014-06-04 JFL Added clock_gettime.obj and gettimeofday.obj. #
# 2014-06-24 JFL Added fstat64.obj and fstat64i32.obj. #
# 2014-07-01 JFL Added mb2wpath.obj. #
# 2016-09-08 JFL Added basename.obj and dirname.obj. #
# 2016-09-12 JFL Added WIN32_OBJECTS, and several WIN32 UTF-8 routines. #
# 2016-10-11 JFL moved debugm.h to SysToolsLib global C include dir. #
# 2017-02-16 JFL Added open.obj. #
# #
# Copyright 2016 Hewlett Packard Enterprise Development LP #
# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 #
###############################################################################
# List of object files to build and include in the MsvcLibX library
# IMPORTANT NOTE: Every time you add an object file in the list here, also
# store its specific source file dependancies below.
OBJECTS = \
+access.obj \
+basename.obj \
+chdir.obj \
+clock_gettime.obj \
+debugv.obj \
+dirent.obj \
+dirname.obj \
+err2errno.obj \
+filetime.obj \
+fnmatch.obj \
+fopen.obj \
+fstat64i32.obj \
+fstat64.obj \
+getcwd.obj \
+getopt.obj \
+getppid.obj \
+gettimeofday.obj \
+iconv.obj \
+lstat64i32.obj \
+lstat64.obj \
+main.obj \
+mb2wpath.obj \
+mkdir.obj \
+mkdtemp.obj \
+mkstemp.obj \
+open.obj \
+readlink.obj \
+realpath.obj \
+spawn.obj \
+strerror.obj \
+strndup.obj \
+strptime.obj \
+symlink.obj \
+uname.obj \
+utime.obj \
+utimes.obj \
+xfreopen.obj \
# +lstat32.obj \
# +lstat32i64.obj \
# WIN32 UTF-8 extension routines, used for implementing UTF-8 support for WIN32 libc.
WIN32_OBJECTS = \
+GetFileAttributes.obj \
+GetFileAttributesEx.obj \
+GetFullPathName.obj \
+GetLongPathName.obj \
+fullpath.obj \
# GnuLib routines that I mistakenly defined here
REMOVED_OBJECTS = \
+error.obj \
+initmain.obj \
+xnmalloc.obj \
###############################################################################
# Include files dependancies #
###############################################################################
I=..\include
CI=$(STINCLUDE)
$(I)\chdir.h: $(I)\unistd.h $(I)\iconv.h $(CI)\debugm.h
$(I)\config.h: $(I)\msvclibx.h $(I)\stdbool.h $(I)\unistd.h
$(I)\direct.h: $(I)\msvclibx.h
$(I)\dirent.h: $(I)\inttypes.h $(I)\sys\stat.h
$(I)\error.h: $(I)\msvclibx.h
# $(I)\fadvise.h:
$(I)\fcntl.h: $(I)\msvclibx.h
$(I)\fnmatch.h: $(I)\msvclibx.h
$(I)\getcwd.h: $(I)\unistd.h $(CI)\debugm.h
# $(I)\getopt.h:
$(I)\grp.h: $(I)\msvclibx.h
# $(I)\inttypes.h:
# $(I)\msvclibx.h:
# $(I)\netdb.h:
$(I)\process.h: $(I)\msvclibx.h
$(I)\pwd.h: $(I)\msvclibx.h
# $(I)\regex.h:
$(I)\sys\stat.h: $(I)\msvclibx.h $(I)\sys\types.h
# $(I)\stdbool.h:
# $(I)\stdint.h:
$(I)\stdio.h: $(I)\msvclibx.h
# $(I)\stdio--.h:
$(I)\stdlib.h: $(I)\msvclibx.h
# $(I)\system.h:
$(I)\unistd.h: $(I)\msvclibx.h $(I)\dirent.h
# $(I)\utime.h:
$(I)\windowsU.h: $(I)\msvclibx.h
$(I)\xfreopen.h: $(I)\msvclibx.h
$(I)\sys\types.h: $(I)\msvclibx.h
###############################################################################
# Source files dependancies #
###############################################################################
access.c: $(I)\MsvcLibX.h $(CI)\debugm.h
basename.c: $(I)\libgen.h
chdir.c: $(CI)\debugm.h $(I)\iconv.h $(I)\unistd.h
clock_gettime.c: $(I)\MsvcLibX.h $(I)\time.h $(I)\sys\stat.h
debugv.c: $(CI)\debugm.h
dirent.c: $(CI)\debugm.h $(I)\dirent.h $(I)\sys\stat.h $(I)\unistd.h
dirname.c: $(I)\libgen.h
err2errno.c: $(I)\MsvcLibX.h $(CI)\debugm.h
error.c: $(I)\config.h $(I)\error.h
filetime.c: $(I)\sys\stat.h
fnmatch.c: $(CI)\debugm.h $(I)\fnmatch.h
fopen.c: $(I)\MsvcLibX.h
fstat64.c: fstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h
fstat64i32.c: fstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h
fullpath.c: $(I)\stdlib.h $(I)\limits.h
getcwd.c: $(CI)\debugm.h $(I)\unistd.h
GetFileAttributesU.c: $(I)\windowsU.h $(I)\limits.h
GetFileAttributesExU.c: $(I)\windowsU.h $(I)\limits.h
GetFullPathNameU.c: $(I)\windowsU.h $(I)\limits.h
GetLongPathNameU.c: $(I)\windowsU.h $(I)\limits.h
getopt.c: $(I)\getopt.h
# getppid.c:
gettimeofday.c: $(I)\MsvcLibX.h $(I)\time.h $(I)\sys\time.h
grp.c: $(I)\grp.h
iconv.c: $(I)\iconv.h
initmain.c: $(I)\config.h
lstat32.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h
lstat32i64.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h
lstat64.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h
lstat64i32.c: lstat.c $(CI)\debugm.h $(I)\dirent.h $(I)\MsvcLibX.h $(I)\sys\stat.h $(I)\stdint.h $(I)\unistd.h
main.c: $(I)\MsvcLibX.h
mb2wpath.c: $(I)\MsvcLibX.h $(CI)\debugm.h
mkdir.c: $(I)\MsvcLibX.h $(I)\sys\stat.h
mkdtemp.c: $(I)\unistd.h
mkstemp.c: $(I)\unistd.h
open.c: $(I)\MsvcLibX.h $(I)\fcntl.h $(CI)\debugm.h
pwd.c: $(I)\pwd.h
readlink.c: $(CI)\debugm.h $(I)\unistd.h $(I)\reparsept.h
realpath.c: $(CI)\debugm.h $(I)\unistd.h
spawm.c: $(CI)\debugm.h $(I)\MsvcLibX.h $(I)\process.h
strerror.c: $(I)\MsvcLibX.h
# strndup.c:
# strptime.c:
symlink.c: $(CI)\debugm.h $(I)\reparsept.h $(I)\unistd.h
uname.c: $(I)\MsvcLibX.h $(I)\sys\utsname.h
utime.c: $(CI)\debugm.h $(I)\unistd.h $(I)\utime.h $(I)\sys\time.h
xfreopen.c: $(I)\xfreopen.h
xnmalloc.c: $(I)\config.h

View File

@ -16,7 +16,7 @@
#ifdef _WIN32 /* Automatically defined when targeting a Win32 application */
#include <windows.h> /* Also includes MsvcLibX' WIN32 UTF-8 extensions */
#include <limits.h>
#include "msvcLimits.h"
/*---------------------------------------------------------------------------*\
* *

View File

@ -16,7 +16,7 @@
#ifdef _WIN32 /* Automatically defined when targeting a Win32 application */
#include <windows.h> /* Also includes MsvcLibX' WIN32 UTF-8 extensions */
#include <limits.h>
#include "msvcLimits.h"
/*---------------------------------------------------------------------------*\
* *

View File

@ -16,8 +16,8 @@
#ifdef _WIN32 /* Automatically defined when targeting a Win32 application */
#include <windows.h> /* Also includes MsvcLibX' WIN32 UTF-8 extensions */
#include <limits.h>
#include "debugm.h" /* MsvcLibX debugging macros */
#include "msvcLimits.h"
#include "msvcDebugm.h" /* MsvcLibX debugging macros */
/*---------------------------------------------------------------------------*\
* *

View File

@ -16,8 +16,8 @@
#ifdef _WIN32 /* Automatically defined when targeting a Win32 application */
#include <windows.h> /* Also includes MsvcLibX' WIN32 UTF-8 extensions */
#include <limits.h>
#include "debugm.h" /* MsvcLibX debugging macros */
#include "msvcLimits.h"
#include "msvcDebugm.h" /* MsvcLibX debugging macros */
/*---------------------------------------------------------------------------*\
* *

View File

@ -1,239 +0,0 @@
###############################################################################
# #
# File name NMakefile #
# #
# Description An NMake file for making all MsvcLibX library versions #
# #
# Notes make.bat looks for a default nmake file called nmakefile. #
# #
# History #
# 2012-10-21 JFL Initial version #
# 2014-03-05 JFL Generate the DOS version only if DOS tools are present. #
# 2014-04-22 JFL Fixed the clean target to work even without 16-bits tools.#
# 2014-05-30 JFL Moved the OBJECTS macro definition to Files.mak. #
# 2014-12-03 JFL Fixed the zip target creation. #
# 2015-11-06 JFL Added support for a Win95 version. #
# 2016-01-11 JFL Added a rule to create the common ..\lib directory. #
# 2016-07-05 JFL Fixed a typo preventing the build of DOS S Debug version. #
# 2016-09-26 JFL Added macro LIBDIR, depending on OUTDIR. #
# Copy the include files to $(OUTDIR). #
# 2016-10-04 JFL Make sure nothing is displayed when doing a make clean. #
# 2016-10-06 JFL Added targets mostlyclean & distclean. #
# 2016-10-11 JFL Adapted for use with make files in the global include dir.#
# 2016-10-13 JFL Added target cleanenv. #
# 2016-11-03 JFL Added target config. #
# Updated the cleanenv: script to display the reg command #
# it uses to delete the global environment variable. #
# 2016-11-07 JFL Place LIBDIR in the parent directory even if OUTDIR defnd.#
# Do not copy include files to OUTDIR anymore. #
# 2016-11-16 JFL Removed the rule for copying INCDIR, not used anymore. #
# 2017-02-16 JFL Default goals now depend on the existence of their #
# corresponding make file. #
# #
# Copyright 2016 Hewlett Packard Enterprise Development LP #
# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 #
###############################################################################
!IF DEFINED(MESSAGES)
!MESSAGE Started MsvcLibX/src/NMakefile in $(MAKEDIR) # Display this make file name
!ENDIF
!IF DEFINED(OUTDIR)
OD=$(OUTDIR)^\
!IF "$(OUTDIR:\=)"=="$(OUTDIR)"
LIBDIR=..\$(OUTDIR)\lib # If OUTDIR is relative, put it in MsvcLibX top directory
!ELSE
LIBDIR=$(OUTDIR)\lib # If OUTDIR is absolute, use it as is
!ENDIF
!ELSE
OD=
LIBDIR=..\lib
!ENDIF
MSG=>con echo # Command for writing a progress message on the console
HEADLINE=$(MSG).&$(MSG) # Output a blank line, then a message
# Default goal: Generate all versions
all: headline \
!IF DEFINED(DOS_CC) && EXIST("$(STINCLUDE)\DOS.mak")
$(OD)DOS\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN95_CC) && EXIST("$(STINCLUDE)\WIN95.mak")
$(OD)WIN95\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN32_CC) && EXIST("$(STINCLUDE)\WIN32.mak")
$(OD)WIN32\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN64_CC) && EXIST("$(STINCLUDE)\WIN64.mak")
$(OD)WIN64\MsvcLibX.lib \
!ENDIF
!IF DEFINED(DOS_CC) && EXIST("$(STINCLUDE)\DOS.mak")
$(OD)DOS\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN95_CC) && EXIST("$(STINCLUDE)\WIN95.mak")
$(OD)WIN95\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN32_CC) && EXIST("$(STINCLUDE)\WIN32.mak")
$(OD)WIN32\DEBUG\MsvcLibX.lib \
!ENDIF
!IF DEFINED(WIN64_CC) && EXIST("$(STINCLUDE)\WIN64.mak")
$(OD)WIN64\DEBUG\MsvcLibX.lib \
!ENDIF
headline:
$(HEADLINE) Building all MsvcLibX library versions
# Define the OBJECTS macro = the list of object files to include in the library
!INCLUDE "Files.mak"
# Create the common libs directory
$(LIBDIR):
$(HEADLINE) Creating directory $(LIBDIR:..=MsvcLibX)
md $(LIBDIR)
# Rules for building specific versions of the MsvcLibX library
$(OD)DOS\MsvcLibX.lib: $(OD)DOS\BIN\T\MsvcLibX.lib $(OD)DOS\BIN\S\MsvcLibX.lib $(OD)DOS\BIN\L\MsvcLibX.lib
@echo Done building all DOS release libraries
$(OD)DOS\DEBUG\MsvcLibX.lib: $(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib $(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib
@echo Done building all DOS debug libraries
$(OD)DOS\BIN\T\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library DOS tiny release version
set OBJECTS=$(OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\T\%" "MEM=T" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXdt.lib
$(OD)DOS\BIN\S\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library DOS small release version
set OBJECTS=$(OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\S\%" "MEM=S" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXds.lib
$(OD)DOS\BIN\L\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library DOS large release version
set OBJECTS=$(OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\OBJ\L\%" "MEM=L" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXdl.lib
$(OD)WIN95\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library WIN95 release version
set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN95.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\OBJ\%" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95.lib
$(OD)WIN32\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library WIN32 release version
set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
set OD=$(OD)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN32.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\OBJ\%" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32.lib
$(OD)WIN64\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library WIN64 release version
set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN64.mak "DEBUG=0" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\OBJ\%" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64.lib
$(OD)DOS\DEBUG\BIN\T\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library DOS tiny debug version
set OBJECTS=$(OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\T\%" "MEM=T" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXdtd.lib
$(OD)DOS\DEBUG\BIN\S\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library DOS small debug version
set OBJECTS=$(OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\S\%" "MEM=S" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXdsd.lib
$(OD)DOS\DEBUG\BIN\L\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library DOS large debug version
set OBJECTS=$(OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)DOS\DEBUG\OBJ\L\%" "MEM=L" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXdld.lib
$(OD)WIN95\DEBUG\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library WIN95 debug version
set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN95.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN95\DEBUG\OBJ\%" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXw95d.lib
$(OD)WIN32\DEBUG\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library WIN32 debug version
set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN32.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN32\DEBUG\OBJ\%" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXw32d.lib
$(OD)WIN64\DEBUG\MsvcLibX.lib: $(LIBDIR) NUL
$(HEADLINE) Building MsvcLibX library WIN64 debug version
set OBJECTS=$(OBJECTS) $(WIN32_OBJECTS)
$(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN64.mak "DEBUG=1" "PROGRAM=MsvcLibX" "OBJECTS=%OBJECTS:+=+$(OD)WIN64\DEBUG\OBJ\%" dirs $@
if exist $@ copy $@ $(LIBDIR)\MsvcLibXw64d.lib
# Erase all global environment variables created by this build
VARS=MSVCLIBX # Global environment variables generated here
cleanenv:
call <<"$(TMP)\cleanenv-$(PID).bat" &:# Delete variables created here
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "KEY=HKCU\Environment"
if not "$(VARS)"=="" for %%v in ($(VARS)) do @(
>>"$(TMP)\cleanenv-$(PID).lst" (echo %%v) &:# Pass the name back to make.bat, for deleting it in the current shell environment
set "VALUE="
for /f "tokens=1,3" %%a in ('reg query "%KEY%" ^| findstr /i /b /r /c:" *%%v "') do set VALUE="%%b"
if defined VALUE ( :# The global environment variable exists. Delete it, using its actual name with the correct case.
set CMD=reg delete "%KEY%" /v %%v /f
echo !CMD!
!CMD! >NUL
)
)
<<
# Dummy target, to delete all files built by these make files
clean mostlyclean distclean:
rem # Delete temporary files
-for /f "delims=" %f in ('dir /b /s *~ *.bak #*# 2^>NUL') do @del "%f"
rem # Delete files built by this nmakefile
-for /f "delims=" %f in ('dir /b /s ..\*.zip *.log 2^>NUL') do @del "%f"
rem # Delete files built by the DOS.mak, WIN32.mak, WIN64.mak make files
rem # But make DOS.mak will fail if 16-bit tools are missing. Workaround:
-if exist $(STINCLUDE)\DOS.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\DOS.mak clean
if exist $(OD)DOS rd /s /q $(OD)DOS
rem # No such problem with the others, but just in case, do the same.
-if exist $(STINCLUDE)\WIN95.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN95.mak clean
if exist $(OD)WIN95 rd /s /q $(OD)WIN95
-if exist $(STINCLUDE)\WIN32.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN32.mak clean
if exist $(OD)WIN32 rd /s /q $(OD)WIN32
-if exist $(STINCLUDE)\WIN64.mak $(MAKE) /$(MAKEFLAGS) /f $(STINCLUDE)\WIN64.mak clean
if exist $(OD)WIN64 rd /s /q $(OD)WIN64
!IF DEFINED(OUTDIR)
-rd /S /Q $(OUTDIR) >NUL 2>&1
!ENDIF
-if "$@"=="distclean" del /Q config.*.bat >NUL 2>&1
# Dummy target, to build a source archive
dist zip:
$(MSG) Building ..\MsvcLibX.zip
cd ..
if exist MsvcLibX.zip del MsvcLibX.zip
set PATH=$(PATH);C:\Program Files\7-zip
7z.exe a MsvcLibX.zip *.txt src\*.bat src\*.mak src\*makefile src\exe src\*.c -r include\*.h lib\
rem # Delete files that got dragged in by wild cards, but that we don't want in the source zip.
7z.exe d MsvcLibX.zip src\config.*.bat lib\*.lib
cd src
# Run the configure.bat script in every subdirectory
config:
rem Nothing to do in $(MAKEDIR) as there is no further child level
# Dummy target, to display a help screen
help:
type <<
Targets:
all Rebuild all library versions (Default)
clean Delete all files built here, and all backup files
distclean Do a clean, then delete config.*.bat files
zip Build a source archive in ..\MsvcLibX.zip. Requires 7-zip.
<<NOKEEP

View File

@ -16,11 +16,12 @@
#define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */
#include <stdio.h>
#include <errno.h>
#include <io.h>
#include "msvcStdio.h"
#include "msvclibx.h"
#include "debugm.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#ifdef _WIN32

View File

@ -20,11 +20,11 @@
#define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ 2005 security warnings */
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <libgen.h>
#include <limits.h>
#include "msvcStdlib.h"
#include "msvcLibgen.h"
#include "msvcLimits.h"
#define TRUE 1
#define FALSE 0

View File

@ -18,12 +18,14 @@
/* Microsoft C libraries include files */
#include <errno.h>
#include <stdio.h>
#include <string.h>
/* MsvcLibX library extensions */
#include <unistd.h>
#include <iconv.h>
#include "debugm.h"
#include "msvcStdio.h"
#include "msvcUnistd.h"
#include "msvcIconv.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#include "sys/msvcTypes.h"
#if defined(_MSDOS)

View File

@ -31,8 +31,8 @@
#define WIN32_LEAN_AND_MEAN /* Avoid lots of unnecessary inclusions */
#include <windows.h>
#include <sys/stat.h> /* For MsvcLibX's Filetime2Timespec */
#include "msvcTime.h"
#include "sys/msvcStat.h" /* For MsvcLibX's Filetime2Timespec */
int clock_gettime(clockid_t clock_id, struct timespec *pTS) {
FILETIME ft;

View File

@ -1,151 +0,0 @@
:# config.DESKTOP-U79TD6T.bat generated by configure.bat on 2020/05/19 Öܶþ 7:50:15.02
:#
:# If changes are needeed, do not edit this file, but instead create a new script
:# called configure.YOURCHOICE.bat. This new script will be invoked automatically
:# by configure.bat while creating this file. Then your script can write extra
:# definitions, or change some of the variables before configure.bat writes them.
:#
:# Invoke configure.bat manually if anything changes in the tools config, such as
:# installing a Visual Studio update, or updating a configure.XXX.bat script.
set "HAS_STINCLUDE=1" &:# Found the System Tools global C includes
set "STINCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# System Tools global C includes
set "HAS_MSVCLIBX=1" &:# Found the MSVC Library eXtensions library
set "MSVCLIBX=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX" &:# MSVC Library eXtensions library
set "HAS_SDK_FLAGS=/DHAS_STINCLUDE=1 /DHAS_MSVCLIBX=1" &:# SDK detection flags for the C compiler
SET "PF32=C:\Program Files (x86)" &:# 32-bits Program Files
SET "PF64=C:\Program Files" &:# 64-bits Program Files
SET "ARCH=AMD64" &:# PROCESSOR_ARCHITECTURE
SET "MASM=" &:# Microsoft 16-bits Assembler base path
SET "MSVC=" &:# Microsoft 16-bits Visual C++ base path
SET "MAPSYM=" &:# 16-bits debugging symbols generator
SET "VSTUDIOLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0" &:# Microsoft Visual Studio (Long path)
SET "VSTUDIO=C:\PROGRA~2\MICROS~2.0" &:# Microsoft Visual Studio (Short path)
SET "VSCOMMONLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7" &:# Microsoft Visual Studio Common Files (Long path)
SET "VSCOMMON=C:\PROGRA~2\MICROS~2.0\Common7" &:# Microsoft Visual Studio Common Files (Short path)
SET "VSIDELONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Long path)
SET "VSIDE=C:\PROGRA~2\MICROS~2.0\Common7\IDE" &:# Microsoft Visual Studio IDE Files (Short path)
SET "VSTOOLSLONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Long paths)
SET "VSTOOLS=C:\PROGRA~2\MICROS~2.0\Common7\Tools" &:# Microsoft Visual Studio Tools (Short paths)
SET "MSVC32LONG=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC" &:# Microsoft Visual C++ 32/64 bits (Long path)
SET "MSVC32=C:\PROGRA~2\MICROS~2.0\VC" &:# Microsoft Visual C++ 32/64 bits (Short path)
SET "WIN_CP=936" &:# Windows Code Page
SET "WIN_CS=gb2312" &:# Windows Character Set
SET "DOS_CP=936" &:# DOS Code Page
SET "DOS_CS=gb2312" &:# DOS Character Set
SET "AS=" &:# Assembler
SET "CC=" &:# C compiler
SET "INCLUDE=C:\Users\admin\Desktop\temp\MyGitHub\C\include" &:# Include paths. Define USER_INCLUDE if needed.
SET "LK=" &:# Linker
SET "LIB=" &:# Libraries paths. Define USER_LIBS if needed.
SET "LB=" &:# Library manager
SET "RC=" &:# Resource compiler
SET "MT=" &:# Manifest tool
SET "DOS_CC=" &:# Microsoft Visual C++ 16-bits compiler
SET "DOS_AS=" &:# Microsoft 16-bits assembler
SET "DOS_LK=" &:# Microsoft 16-bits linker
SET "DOS_LB=" &:# Microsoft 16-bits librarian
SET "DOS_RC=" &:# Microsoft 16-bits resource compiler
SET "DOS_MT=" &:# Microsoft 16-bits manifest tool
SET "DOS_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 16-bits compilation
SET "DOS_VCINC=" &:# Visual C++ 16-bits compiler include dir for MsvcLibX include_next
SET "DOS_CRTINC=" &:# Visual C++ 16-bits CRT library include dir for MsvcLibX include_next
SET "DOS_INCPATH=" &:# Include paths for 16-bits compilation
SET "DOS_LIBPATH=" &:# Libraries paths for 16-bits linking
SET "DOS_WINSDK=" &:# Microsoft Windows 16-bits SDK
SET "DOS_WINSDKINC=" &:# Microsoft Windows 16-bits SDK Include directory
SET "WIN95_CC=" &:# Microsoft Visual C++ 32-bits compiler
SET "WIN95_AS=" &:# Microsoft 32-bits assembler
SET "WIN95_LK=" &:# Microsoft 32-bits linker
SET "WIN95_LB=" &:# Microsoft 32-bits librarian
SET "WIN95_RC=" &:# Microsoft 32-bits resource compiler
SET "WIN95_MT=" &:# Microsoft 32-bits manifest tool
SET "WIN95_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation
SET "WIN95_VCINC=" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next
SET "WIN95_CRTINC=" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next
SET "WIN95_INCPATH=" &:# Include paths for 32-bits compilation
SET "WIN95_LIBPATH=" &:# Libraries paths for 32-bits linking
SET "WIN95_WINSDK=" &:# Microsoft Windows 32-bits SDK
SET "WIN95_WINSDKINC=" &:# Microsoft Windows 32-bits SDK Include directory
SET "WIN32_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.EXE"" &:# Microsoft Visual C++ 32-bits compiler
SET "WIN32_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\ML.EXE"" &:# Microsoft 32-bits assembler
SET "WIN32_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LINK.EXE"" &:# Microsoft 32-bits linker
SET "WIN32_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LIB.EXE"" &:# Microsoft 32-bits librarian
SET "WIN32_RC=" &:# Microsoft 32-bits resource compiler
SET "WIN32_MT=" &:# Microsoft 32-bits manifest tool
SET "WIN32_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 32-bits compilation
SET "WIN32_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 32-bits compiler include dir for MsvcLibX include_next
SET "WIN32_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 32-bits CRT library include dir for MsvcLibX include_next
SET "WIN32_INCPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 32-bits compilation
SET "WIN32_LIBPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x86" &:# Libraries paths for 32-bits linking
SET "WIN32_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 32-bits SDK
SET "WIN32_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 32-bits SDK Include directory
SET "IA64_CC=" &:# Microsoft Visual C++ IA64 compiler
SET "IA64_AS=" &:# Microsoft IA64 assembler
SET "IA64_LK=" &:# Microsoft IA64 linker
SET "IA64_LB=" &:# Microsoft IA64 librarian
SET "IA64_RC=" &:# Microsoft IA64 resource compiler
SET "IA64_MT=" &:# Microsoft IA64 manifest tool
SET "IA64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for IA64 compilation
SET "IA64_VCINC=" &:# Visual C++ IA64 compiler include dir for MsvcLibX include_next
SET "IA64_CRTINC=" &:# Visual C++ IA64 CRT library include dir for MsvcLibX include_next
SET "IA64_INCPATH=" &:# Include paths for IA64 compilation
SET "IA64_LIBPATH=" &:# Libraries paths for IA64 linking
SET "IA64_WINSDK=" &:# Microsoft Windows IA64 SDK
SET "IA64_WINSDKINC=" &:# Microsoft Windows IA64 SDK Include directory
SET "WIN64_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\CL.EXE"" &:# Microsoft Visual C++ 64-bits compiler
SET "WIN64_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ML64.EXE"" &:# Microsoft 64-bits assembler
SET "WIN64_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LINK.EXE"" &:# Microsoft 64-bits linker
SET "WIN64_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\LIB.EXE"" &:# Microsoft 64-bits librarian
SET "WIN64_RC=" &:# Microsoft 64-bits resource compiler
SET "WIN64_MT=" &:# Microsoft 64-bits manifest tool
SET "WIN64_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for 64-bits compilation
SET "WIN64_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ 64-bits compiler include dir for MsvcLibX include_next
SET "WIN64_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ 64-bits CRT library include dir for MsvcLibX include_next
SET "WIN64_INCPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for 64-bits compilation
SET "WIN64_LIBPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64" &:# Libraries paths for 64-bits linking
SET "WIN64_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows 64-bits SDK
SET "WIN64_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows 64-bits SDK Include directory
SET "ARM_CC="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\CL.EXE"" &:# Microsoft Visual C++ ARM compiler
SET "ARM_AS="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\ARMASM.EXE"" &:# Microsoft ARM assembler
SET "ARM_LK="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LINK.EXE"" &:# Microsoft ARM linker
SET "ARM_LB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm\LIB.EXE"" &:# Microsoft ARM librarian
SET "ARM_RC=" &:# Microsoft ARM resource compiler
SET "ARM_MT=" &:# Microsoft ARM manifest tool
SET "ARM_PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_arm;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM compilation
SET "ARM_VCINC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" &:# Visual C++ ARM compiler include dir for MsvcLibX include_next
SET "ARM_CRTINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt" &:# Visual C++ ARM CRT library include dir for MsvcLibX include_next
SET "ARM_INCPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt" &:# Include paths for ARM compilation
SET "ARM_LIBPATH=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX\lib;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\arm" &:# Libraries paths for ARM linking
SET "ARM_WINSDK=C:\Program Files (x86)\Windows Kits\10" &:# Microsoft Windows ARM SDK
SET "ARM_WINSDKINC=C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0" &:# Microsoft Windows ARM SDK Include directory
SET "ARM64_CC=" &:# Microsoft Visual C++ ARM64 compiler
SET "ARM64_AS=" &:# Microsoft ARM64 assembler
SET "ARM64_LK=" &:# Microsoft ARM64 linker
SET "ARM64_LB=" &:# Microsoft ARM64 librarian
SET "ARM64_RC=" &:# Microsoft ARM64 resource compiler
SET "ARM64_MT=" &:# Microsoft ARM64 manifest tool
SET "ARM64_PATH=;C:\Windows\System32;C:\Windows" &:# All tools paths for ARM64 compilation
SET "ARM64_VCINC=" &:# Visual C++ ARM64 compiler include dir for MsvcLibX include_next
SET "ARM64_CRTINC=" &:# Visual C++ ARM64 CRT library include dir for MsvcLibX include_next
SET "ARM64_INCPATH=" &:# Include paths for ARM64 compilation
SET "ARM64_LIBPATH=" &:# Libraries paths for ARM64 linking
SET "ARM64_WINSDK=" &:# Microsoft Windows ARM64 SDK
SET "ARM64_WINSDKINC=" &:# Microsoft Windows ARM64 SDK Include directory
:# List of commands to run when make.bat exits
SET "POST_MAKE_ACTIONS=set "MSVCLIBX=C:\Users\admin\Desktop\temp\MyGitHub\C\MsvcLibX""
exit /b 0 &:# Configuration done successfully

View File

@ -1,36 +0,0 @@
@echo off
:#*****************************************************************************
:# *
:# Filename: configure.MsvcLibX.bat *
:# *
:# Description: Special make actions for rebuilding the MsvcLibX library *
:# *
:# Notes: *
:# *
:# History: *
:# 2015-11-06 JFL Created this script. *
:# 2016-09-27 JFL Correct the final MSVCLIBX if there's a different OUTDIR. *
:# 2016-11-03 JFL Removed the side effect creating %OUTDIR%. *
:# 2016-11-07 JFL Removed the dependency on OUTDIR. *
:# Immediately set the system environment. *
:# 2016-11-16 JFL Allow using a predefined alias for this lib base path. *
:# 2016-12-16 JFL Only use setx if requested by user, with PERSISTENT_VARS. *
:# *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:#*****************************************************************************
:# Get the full pathname of the MsvcLibX library base directory
if defined MSVCLIBX if not exist "%MSVCLIBX%\include\msvclibx.h" set "MSVCLIBX=" &:# Allow overriding with another alias name, but ignore invalid overrides
if not defined MSVCLIBX for /f "delims=" %%d in ('"pushd .. & cd & popd"') do SET "MSVCLIBX=%%d" &:# Default: Use the current directory
:# Declare the SDKs and libraries we need
%BEGIN_SDK_DEFS%
%USE_SDK% MSVCLIBX &:# Triggers the emission of a %CONFIG% record for MSVCLIBX
%END_SDK_DEFS%
:# Set the local environment variable just before make exits, so that future commands in this CMD window have it.
%ADD_POST_MAKE_ACTION% set "MSVCLIBX=%MSVCLIBX%"
:# Set the system environment variable, so that other CMD windows opened later on inherit it
if defined PERSISTENT_VARS setx MSVCLIBX "%MSVCLIBX%" >NUL

View File

@ -1,35 +0,0 @@
@echo off
:#*****************************************************************************
:# *
:# Filename: configure.bat *
:# *
:# Description: Detect system-specific settings and create config.*.bat *
:# *
:# Notes: Proxy script for %STINCLUDE%\configure.bat. *
:# *
:# Make any change needed in %STINCLUDE%\configure.bat. *
:# *
:# History: *
:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. *
:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. *
:# *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:#*****************************************************************************
:# Get the full pathname of the STINCLUDE library directory
if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides
for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above.
for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d"
)
if not defined STINCLUDE ( :# Try getting the copy in the master environment
for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v"
)
if not exist %STINCLUDE%\make.bat (
>&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE.
exit /b 1
)
if [%1]==[-d] echo "%STINCLUDE%\configure.bat" %*
"%STINCLUDE%\configure.bat" %*

View File

@ -13,7 +13,7 @@
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#include "debugm.h"
#include "msvcDebugm.h"
#if defined(_DEBUG)

View File

@ -38,7 +38,7 @@
#define _UTF8_SOURCE /* Generate the UTF-8 version of WIN32 printf & scandir */
#include "dirent.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */
#include "msvcDirent.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */
#ifndef _DIRENT_FOR_DOS_WINDOWS
#error "This requires MsvcLibX own version of dirent.h for DOS/Windows"
#endif
@ -49,9 +49,10 @@
#include <memory.h>
#include <errno.h>
/* MsvcLibX library extensions */
#include <unistd.h> /* For readlink() */
#include <sys/stat.h> /* For Filetime2String() */
#include "debugm.h" /* Use our house debugging framework */
#include "msvcUnistd.h" /* For readlink() */
#include "sys/msvcStat.h" /* For Filetime2String() */
#include "msvcDebugm.h" /* Use our house debugging framework */
#include "msvcLimits.h" /* Use our house debugging framework */
/*****************************************************************************\
* *

View File

@ -23,8 +23,8 @@
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <libgen.h>
#include <limits.h>
#include "msvcLibgen.h"
#include "msvcLimits.h"
#define TRUE 1
#define FALSE 0

View File

@ -20,7 +20,7 @@
#include <errno.h>
#include <stdio.h>
/* MsvcLibX library extensions */
#include "debugm.h"
#include "msvcDebugm.h"
#ifdef _WIN32
@ -65,7 +65,6 @@ int _get_errno_from_oserr(unsigned long dwErr) {
return errno;
}
#else
#pragma message("Using the default " MSVCLIBX_STRINGIZE(_get_errno_from_oserr) "()")
/* Equivalent function in MSVC library. Does not know about symlink errors. */
extern int __cdecl _get_errno_from_oserr(unsigned long oserrno);
#endif

99
deps/MsvcLibX/src/exe vendored
View File

@ -1,99 +0,0 @@
#!/bin/bash
#*****************************************************************************#
# #
# Filename: exe #
# #
# Description: Build simple C/C++ programs for Unix/Linux #
# #
# Notes: Usage: ./exe PROGRAM #
# #
# Stores the executables in $OS.$PROC/[Debug/] for #
# consistency with the Windows build tools. #
# This allows sharing sources in a host system, and #
# using VMs for building the various Windows and Linux #
# versions in a set of OS-specific subdirectories. #
# #
# History: #
# 2013-12-16 JFL Added support for MinGW64. #
# 2015-12-12 JFL Help now displays the output directory name. #
# 2016-01-07 JFL Added compilation option -Wall. #
# #
# © Copyright 2016 Hewlett Packard Enterprise Development LP #
# Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 #
#*****************************************************************************#
FileNoCase() # Case-independant search for a file.
{
find . -type f | grep -i -E "./$1$" | sed s=./==
}
# Identify the OS
OS=`uname -s`
PROC=`uname -p`
if [[ "$OS" == "OSF1" && "`uname -m`" == "alpha" ]] ; then
OS=Tru64
fi
if [[ "$OS" == "WindowsNT" ]] ; then
OS=WIN32
fi
OUTDIR=$OS.$PROC
if [[ "${OS:0:7}" == "MINGW32" ]] ; then # Ex: "MINGW32_NT-6.1"
OUTDIR=MINGW32 # MigGW shell if NOT case sensitive
# 2013-12-16 Actually, the 64-bits tool chain also reports MINGW32_NT-6.1
# So distinguish the two by whether /mingw is mounted on C:\MinGW or C:\MinGW64
if mount | grep /mingw | grep 64 > /dev/null ; then
OUTDIR=MINGW64 # MigGW shell if NOT case sensitive
fi
fi
if [[ "${OS:0:7}" == "MINGW64" ]] ; then # Ex: ?
OUTDIR=MINGW64
fi
if [[ "${OS:0:6}" == "CYGWIN" ]] ; then # Ex: "CYGWIN_NT-6.1-WOW64"
OUTDIR=cygwin # Cygwin shell if case sensitive, so use lower case
fi
# Command line analysis.
case "$1" in
"" | "-h" | "-?" | --help)
echo "Build simple C/C++ programs, storing the executables in $OUTDIR/"
echo "Usage: ./exe PROGRAM"
exit 0
;;
esac
# Identify the source file and program to build.
PROGRAM=$1
shift
SOURCES=`FileNoCase ${PROGRAM}.c`
CFLAGS="-std=c99 -Wall" # Force compilation in C, even if there are // comments.
if [[ "${SOURCES}" == "" ]] ; then
SOURCES=`FileNoCase ${PROGRAM}.cpp`
CFLAGS="-std=gnu++98 -lstdc++" # Force compilation in C++, even if plain C.
# -lstdc++ prevents error "undefined reference to '__gxx_personality_v0'"
fi
if [[ "${SOURCES}" == "" ]] ; then
echo "Failed to find ${PROGRAM} source."
exit 1
fi
# Make sure our include directories are accessible
if [[ -d "/u/JFL/SRC/Include" ]] ; then
if [[ ":$C_INCLUDE_PATH:" != *:/u/JFL/SRC/Include:* ]] ; then
if [[ "$C_INCLUDE_PATH" == "" ]] ; then
export C_INCLUDE_PATH="/u/JFL/SRC/Include"
else
export C_INCLUDE_PATH="$C_INCLUDE_PATH:/u/JFL/SRC/Include"
fi
fi
fi
echo "# C_INCLUDE_PATH=\"$C_INCLUDE_PATH\""
# Build it.
# gmake CC=gcc CFLAGS="$CFLAGS" SOURCES="$SOURCES" PROGRAM="$PROGRAM" OS="$OS" $*
mkdir -p $OUTDIR
echo "gcc $CFLAGS -U_DEBUG $SOURCES -o $OUTDIR/$PROGRAM"
gcc $CFLAGS -U_DEBUG $SOURCES -o $OUTDIR/$PROGRAM
mkdir -p $OUTDIR/debug
echo "gcc $CFLAGS -D_DEBUG $SOURCES -o $OUTDIR/debug/$PROGRAM"
gcc $CFLAGS -D_DEBUG $SOURCES -o $OUTDIR/debug/$PROGRAM

View File

@ -1,82 +0,0 @@
@echo off
:#*****************************************************************************
:# *
:# Filename: exe.bat *
:# *
:# Description: Front end to make.bat, to simply build multiple targets *
:# *
:# Arguments: Use option -? to display a help screen *
:# *
:# Notes: Builds the 16-bits MS-DOS version if Visual C++ 1.52 is *
:# installed in its default location in C:\MSVC. *
:# *
:# History: *
:# 2003-03-31 JFL Adapted from previous projects *
:# 2014-03-21 JFL Builds the 16-bits MS-DOS version if Visual C++ 1.52 is *
:# installed in its default location in C:\MSVC. *
:# 2014-03-27 JFL Changed option -f to use nmake option /A. *
:# Added option -r for completeness. *
:# 2015-11-13 JFL Adapted to the new multitarget make system. *
:# *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:#*****************************************************************************
setlocal enableextensions enabledelayedexpansion
goto main
:main
set "FORCE=0"
set "ACTION=default"
set "EXEC="
set "MAKEOPTS="
goto get_arg
:next_arg
shift
:get_arg
if .%1.==.-?. goto help
if .%1.==./?. goto help
if .%1.==.-a. set "ACTION=all" & goto next_arg
if .%1.==.-d. set "ACTION=debug" & goto next_arg
if .%1.==.-f. set "FORCE=1" & goto next_arg
if .%1.==.-r. set "ACTION=release" & goto next_arg
if .%1.==.-X. set "EXEC=echo" & goto next_arg
set MAKEOPTS=%2 %3 %4 %5 %6 %7 %8 %9
if "%FORCE%"=="1" set "MAKEOPTS=%MAKEOPTS% /A"
goto %ACTION%
:help
echo.
echo..exe program builder from a C or C++ source
echo.
echo.Usage: exe [options] program [nmake_options]
echo.
echo.Options:
echo.
echo. -? Display this help page
echo. -a Builds all release ^& debug versions (default)
echo. -d Builds all debug versions only
echo. -f Force building all program targets, irrespective of file dates
echo. -r Builds all release versions only
echo. -X Display the make command generated and exit
echo.
echo.Notes:
echo.* exe myprog ^<==^> make myprog.exe debug\myprog.exe
echo.* This builds all possible OS targets
echo.* To force rebuilding all targets, irrespective of their date,
echo. use nmake option /A. So: exe -f myprog ^<==^> exe myprog /A
goto :eof
:release
%EXEC% make %MAKEOPTS% %1.exe
goto :eof
:debug
%EXEC% make %MAKEOPTS% debug\%1.exe
goto :eof
:default
:all
%EXEC% make %MAKEOPTS% %1.exe debug\%1.exe
goto :eof

View File

@ -9,7 +9,7 @@
* History: *
* 2014-02-26 JFL Created this module. *
* 2014-03-24 JFL Renamed "statx.h" as the standard <sys/stat.h>. *
* 2014-07-03 JFL Filetime2String: Output time with µs precision if possib. *
* 2014-07-03 JFL Filetime2String: Output time with <EFBFBD>s precision if possib. *
* 2016-09-13 JFL Fixed a warning. *
* *
* Copyright 2016 Hewlett Packard Enterprise Development LP *
@ -18,8 +18,8 @@
#define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */
#include <time.h> /* Define time_t */
#include <sys/stat.h>
#include "msvcTime.h" /* Define time_t */
#include "sys/msvcStat.h"
#ifdef _MSDOS
@ -230,7 +230,7 @@ struct tm *LocalFileTime(const time_t *pt) {
}
/* Generate a string with the local file time, in the ISO 8601 date/time format */
/* 2014-07-03 Output time with µs precision if possible */
/* 2014-07-03 Output time with <EFBFBD>s precision if possible */
char *Filetime2String(const FILETIME *pFT, char *pBuf, size_t nBufSize) {
FILETIME lft;
SYSTEMTIME sTime;
@ -246,7 +246,7 @@ char *Filetime2String(const FILETIME *pFT, char *pBuf, size_t nBufSize) {
uli.LowPart = lft.dwLowDateTime;
uli.HighPart = lft.dwHighDateTime;
iFraction = (int)(uli.QuadPart % 10000000); /* FILETIME has 100ns resolution */
iFraction /= 10; /* Convert 100ns resolution to 1µs resolution */
iFraction /= 10; /* Convert 100ns resolution to 1<EFBFBD>s resolution */
wsprintf(pBuf+19, ".%06d", iFraction);
} else if (nBufSize >= 24) {
wsprintf(pBuf+19, ".%03d", sTime.wMilliseconds);

View File

@ -26,8 +26,8 @@
#include <string.h>
#include <malloc.h>
#include "fnmatch.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */
#include "debugm.h"
#include "msvcFnmatch.h" /* Include our associated .h, in the same dir as this .c. Do not use <>. */
#include "msvcDebugm.h"
#ifndef TRUE
#define TRUE 1

View File

@ -21,10 +21,10 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
/* MsvcLibX library extensions */
#include <sys/stat.h>
#include "debugm.h"
#include <stdint.h>
/* MsvcLibX library extensions */
#include "sys/msvcStat.h"
#include "msvcDebugm.h"
#if defined(_MSDOS)

View File

@ -18,12 +18,12 @@
#define _UTF8_SOURCE /* Generate the UTF-8 version of routines */
#include <stdlib.h>
#include <limits.h>
#include <malloc.h>
#include "msvcLimits.h"
#ifdef _WIN32 /* Automatically defined when targeting a Win32 application */
#include <windows.h> /* Also includes MsvcLibX' WIN32 UTF-8 extensions */
#include "msvcWindows.h" /* Also includes MsvcLibX' WIN32 UTF-8 extensions */
/*---------------------------------------------------------------------------*\
* *

View File

@ -20,8 +20,9 @@
#include <errno.h>
#include <stdio.h>
/* MsvcLibX library extensions */
#include <unistd.h>
#include "debugm.h"
#include "msvcUnistd.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#if defined(_MSDOS)

View File

@ -40,7 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt.h"
#include "msvcGetopt.h"
#ifndef _DIAGASSERT
#ifdef NDEBUG

View File

@ -21,7 +21,7 @@
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#include <unistd.h>
#include "msvcUnistd.h"
#ifdef _WIN32

View File

@ -15,8 +15,8 @@
#include "msvclibx.h"
#include <time.h>
#include <sys/time.h>
#include "msvcTime.h"
#include "sys/msvcTime.h"
#ifdef _MSDOS
/* MS-DOS only has a 1-second resolution on system time.

View File

@ -23,8 +23,9 @@
#include <stdio.h>
#include <string.h>
/* MsvcLibX library extensions */
#include "iconv.h"
#include "debugm.h"
#include "msvcIconv.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#if defined(_MSDOS)

View File

@ -29,13 +29,14 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
/* MsvcLibX library extensions */
#include "msvclibx.h"
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h> /* For ResolveLinks() definition */
#include "debugm.h"
#include <stdint.h>
#include <sys/msvcStat.h>
#include "msvcDirent.h"
#include "msvcUnistd.h" /* For ResolveLinks() definition */
#include "msvcDebugm.h"
#include "msvcLimits.h"
#if defined(_MSDOS)
/* Make sure it's only defined it in one of the lstatxxx versions */

View File

@ -19,13 +19,13 @@
#define _UTF8_SOURCE
#define _CRT_SECURE_NO_WARNINGS /* Avoid depreciation warnings */
#include <stdio.h>
#include "msvclibx.h"
#include "msvcStdio.h"
#ifdef _WIN32
#include <windows.h>
#include <iconv.h> /* For MsvcLibX' codePage global variable */
#include "msvcIconv.h" /* For MsvcLibX' codePage global variable */
/*---------------------------------------------------------------------------*\
* *

View File

@ -1,35 +0,0 @@
@echo off
:#*****************************************************************************
:# *
:# Filename: make.bat *
:# *
:# Description: Build DOS and Windows targets *
:# *
:# Notes: Proxy script for %STINCLUDE%\make.bat. *
:# *
:# If any change is needed, put it in %STINCLUDE%\make.bat. *
:# *
:# History: *
:# 2016-10-10 JFL jf.larvoire@hpe.com created this file. *
:# 2016-12-15 JFL Search for the real make.bat in [.|..|../..]\include. *
:# *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:#*****************************************************************************
:# Get the full pathname of the STINCLUDE library directory
if defined STINCLUDE if not exist "%STINCLUDE%\make.bat" set "STINCLUDE=" &:# Allow overriding with another alias name, but ignore invalid overrides
for %%p in (. .. ..\..) do if not defined STINCLUDE if exist %%p\include\make.bat ( :# Default: Search it the current directory, and 2 levels above.
for /f "delims=" %%d in ('"pushd %%p\include & cd & popd"') do SET "STINCLUDE=%%d"
)
if not defined STINCLUDE ( :# Try getting the copy in the master environment
for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v"
)
if not exist %STINCLUDE%\make.bat (
>&2 echo %0 Error: Cannot find SysToolsLib's global C include directory. Please define variable STINCLUDE.
exit /b 1
)
if [%1]==[-d] echo "%STINCLUDE%\make.bat" %*
"%STINCLUDE%\make.bat" %*

View File

@ -17,7 +17,7 @@
#define _UTF8_SOURCE /* Generate the UTF-8 version of printf routines */
#include "msvclibx.h"
#include "debugm.h"
#include "msvcDebugm.h"
#if defined(_WIN32)

View File

@ -22,8 +22,9 @@
#include <direct.h> /* For _mkdir() */
#include <errno.h>
/* MsvcLibX library extensions */
#include <sys/stat.h>
#include <sys/msvcStat.h>
#include "msvclibx.h"
#include "msvcLimits.h"
#ifdef _WIN32

View File

@ -13,11 +13,11 @@
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>
#include "msvcUnistd.h"
char *mkdtemp(char *pszName) {
char *pszXXX, *pc;

View File

@ -15,7 +15,7 @@
#define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */
#include <unistd.h>
#include "msvcUnistd.h"
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>

View File

@ -19,8 +19,9 @@
#include <errno.h>
#include "msvclibx.h"
#include "fcntl.h"
#include "debugm.h"
#include "msvcFcntl.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#ifdef _WIN32

View File

@ -27,16 +27,17 @@
#define _UTF8_SOURCE /* Generate the UTF-8 version of routines */
#include <unistd.h>
#include "msvcUnistd.h"
#pragma comment(lib, "Mpr.lib")
#include <errno.h>
#include "debugm.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#ifdef _WIN32
#include <windows.h>
#include "reparsept.h"
#include "msvcReparsept.h"
/* Get the Reparse Point Tag for a mount point - Wide char version */
/* See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365511(v=vs.85).aspx */

View File

@ -31,13 +31,15 @@
#define _UTF8_SOURCE /* Generate the UTF-8 version of routines */
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <direct.h> /* For _getdcwd() */
#include <ctype.h> /* For toupper() */
#include "debugm.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#include "msvcUnistd.h"
#include "msvcWindows.h"
#define TRUE 1
#define FALSE 0

View File

@ -19,8 +19,9 @@
/* Microsoft C libraries include files */
#include <stdio.h>
/* MsvcLibX library extensions */
#include "debugm.h"
#include "msvcDebugm.h"
#include "msvclibx.h"
#include "msvcLimits.h"
#ifdef _WIN32

View File

@ -1,125 +0,0 @@
@echo off
:******************************************************************************
:* *
:* Filename: src2objs.bat *
:* *
:* Description: Generate object files names from source files names *
:* *
:* Notes: *
:* *
:* History: *
:* 2010-04-07 JFL Created this batch. *
:* *
:# © Copyright 2016 Hewlett Packard Enterprise Development LP *
:# Licensed under the Apache 2.0 license www.apache.org/licenses/LICENSE-2.0 *
:******************************************************************************
setlocal 2>NUL
set ARG0=%0
:# Mechanism for calling subroutines. Done by {call %0 _call_ label [arguments]}.
if .%1.==._call_. shift /2 & goto %2
set CALL=call %0 _call_
set RETURN=goto end
:# Silent return. Used for routines silently called via call :label.
set _RETURN=goto _end
set PUTVARS=call :putvars
:# Set global defaults
setlocal
set OUTFILE=obj\objects.mak
set OUTPATH=obj
set NO_EXEC=0
goto get_args
:help
echo Generate object files names from source files names
echo.
echo Usage: %ARG0% [options] source ...
echo.
echo Options:
echo -?^|-h This help
echo -o {pathname} Output file pathname. Default: %OUTFILE%
echo -X Display object files names, but do not create the output file
goto end
:get_args
if .%1.==.. goto help
if .%1.==.-?. goto help
if .%1.==./?. goto help
if %1==-o shift & goto set_out
if %1==-X shift & goto no_exec
goto go
:set_out
set OUTFILE=%1
:# Split the path. Uses a fake drive @ to prevent prepending the current path on an existing drive.
for %%F in (@:"%OUTFILE%") do (
set "OUTPATH=%%~dpF"
)
:# Remove the head "@:\ and tail \ to the path
set "OUTPATH=%OUTPATH:~4,-1%"
shift
goto get_args
:no_exec
set NO_EXEC=1
goto get_args
:# Check prerequisites
:check
verify other 2>nul
setlocal enableextensions
if errorlevel 1 (
echo>&2 Error: Unable to enable command extensions.
exit /b 1
)
set VAR=before
if "%VAR%" == "before" (
set VAR=after
if not "!VAR!" == "after" (
echo>&2 Error: Delayed environment variable expansion must be enabled.
echo>&2 Please restart your cmd.exe shell with the /V option,
echo>&2 or set HKLM\Software\Microsoft\Command Processor\DelayedExpansion=1
exit /b 1
)
)
%_RETURN%
:go
%CALL% check
if errorlevel 1 exit /b 1
set OBJECTS=
:next
if .%1.==.. goto done
for %%s in (%1) do (
set EXT=%%~xs
set OBJ=
if .!EXT!.==..c. set OBJ=obj
if .!EXT!.==..C. set OBJ=obj
if .!EXT!.==..cpp. set OBJ=obj
if .!EXT!.==..CPP. set OBJ=obj
if .!EXT!.==..asm. set OBJ=obj
if .!EXT!.==..ASM. set OBJ=obj
if .!EXT!.==..rc. set OBJ=res
if .!EXT!.==..RC. set OBJ=res
if .!OBJ!.==.. (
echo>&2 Error: Unsupported source type: !EXT!
echo>&2 Please add a conversion rule in %ARG0%
) else (
if .!OBJECTS!.==.. (
set OBJECTS=%OUTPATH%\%%~ns.!OBJ!
) else (
set OBJECTS=!OBJECTS! %OUTPATH%\%%~ns.!OBJ!
)
)
)
shift
goto next
:done
echo OBJECTS=%OBJECTS%
if %NO_EXEC%==0 echo>%OUTFILE% OBJECTS=%OBJECTS%
:end
:_end

View File

@ -27,17 +27,18 @@
#define _UTF8_SOURCE /* Generate the UTF-8 version of routines */
#include <unistd.h>
#include "msvcUnistd.h"
#pragma comment(lib, "Mpr.lib")
#include <errno.h>
#include "debugm.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#ifdef _WIN32
#include <windows.h>
#include "reparsept.h"
#include "msvcReparsept.h"
/*---------------------------------------------------------------------------*\
* *

View File

@ -21,7 +21,7 @@
* Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
\*****************************************************************************/
#include "sys/utsname.h"
#include "sys/msvcTsname.h"
#include <stdlib.h> /* For itoa() */
static char major[4] = {0};

View File

@ -22,10 +22,10 @@
#define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */
#include <errno.h>
#include <sys/time.h> /* Must be included before any direct or indirect <windows.h> inclusion */
#include <utime.h>
#include "debugm.h"
#include "sys/msvcTime.h" /* Must be included before any direct or indirect <windows.h> inclusion */
#include "msvcUtime.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#if defined(_DEBUG)
#include <stdio.h>
@ -35,7 +35,7 @@
#include <windows.h>
#include <io.h> /* For MSVC's _get_osfhandle() */
#include <unistd.h> /* For MsvcLibX's ResolveLinks() */
#include "msvcUnistd.h" /* For MsvcLibX's ResolveLinks() */
/* Convert a Windows FILETIME to a Unix time_t.
A FILETIME is the number of 100-nanosecond intervals since January 1, 1601.

View File

@ -23,10 +23,10 @@
#define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */
#include <errno.h>
#include <sys/time.h> /* Must be included before any direct or indirect <windows.h> inclusion */
#include <sys/stat.h>
#include "debugm.h"
#include "sys/msvcTime.h" /* Must be included before any direct or indirect <windows.h> inclusion */
#include "sys/msvcStat.h"
#include "msvcDebugm.h"
#include "msvcLimits.h"
#if defined(_DEBUG)
#include <stdio.h>
@ -36,7 +36,7 @@
#include <windows.h>
#include <io.h> /* For MSVC's _get_osfhandle() */
#include <unistd.h> /* For MsvcLibX's ResolveLinks() */
#include "msvcUnistd.h" /* For MsvcLibX's ResolveLinks() */
DEBUG_CODE(
int Timeval2String(char *buf, size_t bufsize, const struct timeval *tvp) {

View File

@ -18,7 +18,7 @@
#include <io.h>
#include <fcntl.h>
#include <string.h>
#include "xfreopen.h"
#include "msvcXfreopen.h"
FILE *xfreopen(const char *filename, const char *mode, FILE *stream) {
int iMode = 0;

View File

@ -228,6 +228,8 @@ typedef unsigned long ULONG_PTR;
#include "config.h"
#endif /* HAVE_PTW32_CONFIG_H */
#include "msvcTime.h"
#if !defined(NEED_FTIME)
#include <time.h>
#else /* NEED_FTIME */

25
deps/pthread/sched.h vendored
View File

@ -100,18 +100,19 @@
#endif
#endif /* PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX */
#if (defined(__MINGW64__) || defined(__MINGW32__)) || defined(_UWIN)
# if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX
/* For pid_t */
# include <sys/types.h>
/* Required by Unix 98 */
# include <time.h>
# else
typedef int pid_t;
# endif
#else
typedef int pid_t;
#endif
// #if (defined(__MINGW64__) || defined(__MINGW32__)) || defined(_UWIN)
// # if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX
// /* For pid_t */
// # include <sys/types.h>
// /* Required by Unix 98 */
// # include <time.h>
// # else
// typedef int pid_t;
// # endif
// #else
// typedef int pid_t;
// #endif
#include <sys/msvcTypes.h>
/* Thread scheduling policies */

View File

@ -99,6 +99,8 @@
#endif
#endif /* PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX */
#include "sys/msvcTypes.h"
#define _POSIX_SEMAPHORES
#if defined(__cplusplus)

View File

@ -56,18 +56,6 @@ int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstP
// TAOS_OS_FUNC_FILE_GETTMPFILEPATH
void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath);
#ifdef TAOS_OS_FUNC_FILE_ISDIR
#define S_ISDIR(m) (((m) & 0170000) == (0040000))
#endif
#ifdef TAOS_OS_FUNC_FILE_ISREG
#define S_ISREG(m) !(S_ISDIR(m))
#endif
#ifdef TAOS_OS_FUNC_FILE_ISLNK
#define S_ISLNK(m) 0
#endif
#ifndef TAOS_OS_FUNC_FILE_FTRUNCATE
#define taosFtruncate ftruncate
#endif

View File

@ -18,9 +18,7 @@
#include <assert.h>
#include <ctype.h>
#include <direct.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <locale.h>
#include <intrin.h>
@ -35,15 +33,17 @@
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <inttypes.h>
#include "winsock2.h"
#include <WS2tcpip.h>
#include <winbase.h>
#include <Winsock2.h>
#include <process.h>
#include <time.h>
#include <inttypes.h>
#include "msvcProcess.h"
#include "msvcDirect.h"
#include "msvcFcntl.h"
#include "sys/msvcStat.h"
#include "sys/msvcTypes.h"
#ifdef __cplusplus
extern "C" {
@ -126,7 +126,6 @@ char *stpncpy (char *dest, const char *src, size_t n);
typedef int (*__compar_fn_t)(const void *, const void *);
#define ssize_t int
#define bzero(ptr, size) memset((ptr), 0, (size))
#define mkdir(pathname, mode) _mkdir(pathname)
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define wcsncasecmp _wcsnicmp
@ -138,7 +137,6 @@ typedef int (*__compar_fn_t)(const void *, const void *);
#define twrite write
#define getpid _getpid
int gettimeofday(struct timeval *tv, struct timezone *tz);
struct tm *localtime_r(const time_t *timep, struct tm *result);
char * strptime(const char *buf, const char *fmt, struct tm *tm);
char * strsep(char **stringp, const char *delim);
@ -147,11 +145,6 @@ int flock(int fd, int option);
int fsync(int filedes);
char * strndup(const char *s, size_t n);
// for function open in stat.h
#define S_IRWXU _S_IREAD
#define S_IRWXG _S_IWRITE
#define S_IRWXO _S_IWRITE
// for access function in io.h
#define F_OK 00 //Existence only
#define W_OK 02 //Write - only

View File

@ -16,18 +16,6 @@
#include <time.h>
#include <winsock2.h>
int gettimeofday(struct timeval *tv, struct timezone *tz) {
time_t t;
t = time(NULL);
SYSTEMTIME st;
GetLocalTime(&st);
tv->tv_sec = (long)t;
tv->tv_usec = st.wMilliseconds * 1000;
return 0;
}
struct tm *localtime_r(const time_t *timep, struct tm *result) {
localtime_s(result, timep);
return result;

View File

@ -18,7 +18,6 @@
#include "tchecksum.h"
#include "tsdbMain.h"
#include "tutil.h"
#include "dirent.h"
#define TAOS_RANDOM_FILE_FAIL_TEST
@ -203,7 +202,7 @@ void tsdbSeekFileGroupIter(SFileGroupIter *pIter, int fid) {
pIter->index = -1;
pIter->fileId = -1;
} else {
pIter->index = POINTER_DISTANCE(ptr, pFileH->pFGroup) / sizeof(SFileGroup);
pIter->index = (int)(POINTER_DISTANCE(ptr, pFileH->pFGroup) / sizeof(SFileGroup));
pIter->fileId = ((SFileGroup *)ptr)->fileId;
}
}