diff --git a/cmake/define.inc b/cmake/define.inc index 73d4ccb37e..b1e8f097be 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -121,6 +121,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) diff --git a/cmake/install.inc b/cmake/install.inc index 8d3acde45d..98a60ace7b 100755 --- a/cmake/install.inc +++ b/cmake/install.inc @@ -27,7 +27,7 @@ ELSEIF (TD_WINDOWS_64) #INSTALL(TARGETS taos RUNTIME DESTINATION driver) #INSTALL(TARGETS shell RUNTIME DESTINATION .) IF (TD_MVN_INSTALLED) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-1.0.2-dist.jar DESTINATION connector/jdbc) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.0-dist.jar DESTINATION connector/jdbc) ENDIF () ELSE () INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll DESTINATION driver) diff --git a/deps/MsvcLibX/CMakeLists.txt b/deps/MsvcLibX/CMakeLists.txt index 7f24d34dd5..fc77a3b447 100644 --- a/deps/MsvcLibX/CMakeLists.txt +++ b/deps/MsvcLibX/CMakeLists.txt @@ -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}) diff --git a/deps/MsvcLibX/README.md b/deps/MsvcLibX/README.md deleted file mode 100644 index 8f689412cb..0000000000 --- a/deps/MsvcLibX/README.md +++ /dev/null @@ -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. diff --git a/deps/MsvcLibX/config.DESKTOP-U79TD6T.bat b/deps/MsvcLibX/config.DESKTOP-U79TD6T.bat deleted file mode 100644 index b1b68e1540..0000000000 --- a/deps/MsvcLibX/config.DESKTOP-U79TD6T.bat +++ /dev/null @@ -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 diff --git a/deps/MsvcLibX/configure.bat b/deps/MsvcLibX/configure.bat deleted file mode 100644 index 7037eb92af..0000000000 --- a/deps/MsvcLibX/configure.bat +++ /dev/null @@ -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" %* diff --git a/deps/MsvcLibX/include/debugm.h b/deps/MsvcLibX/include/msvcDebugm.h similarity index 96% rename from deps/MsvcLibX/include/debugm.h rename to deps/MsvcLibX/include/msvcDebugm.h index b20a7035c6..5b3c38f45b 100644 --- a/deps/MsvcLibX/include/debugm.h +++ b/deps/MsvcLibX/include/msvcDebugm.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: debugm.h * * * @@ -44,7 +44,7 @@ * 2016-10-04 JFL Added macros DEBUG_OFF(), DEBUG_MORE(), DEBUG_LESS(). * * Allow using DEBUG_ON()/MORE()/LESS()/OFF() in release mode. * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/direct.h b/deps/MsvcLibX/include/msvcDirect.h similarity index 79% rename from deps/MsvcLibX/include/direct.h rename to deps/MsvcLibX/include/msvcDirect.h index 7cedc1cf7d..31017ce50c 100644 --- a/deps/MsvcLibX/include/direct.h +++ b/deps/MsvcLibX/include/msvcDirect.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: direct.h * * * @@ -10,7 +10,7 @@ * 2014-03-24 JFL Created this file, with content moved from unistd.h. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,7 +19,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(direct.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #undef mkdir /* This MSVC macro is incompatible with mkdir() function in unistd.h */ diff --git a/deps/MsvcLibX/include/dirent.h b/deps/MsvcLibX/include/msvcDirent.h similarity index 96% rename from deps/MsvcLibX/include/dirent.h rename to deps/MsvcLibX/include/msvcDirent.h index ac702e01dd..db146a5998 100644 --- a/deps/MsvcLibX/include/dirent.h +++ b/deps/MsvcLibX/include/msvcDirent.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: dirent.h * * * @@ -24,7 +24,7 @@ * 2015-12-07 JFL Added the conditional definition of symlink constants, so * * that our code builds even in XP and older Windows SDKs. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/error.h b/deps/MsvcLibX/include/msvcError.h similarity index 83% rename from deps/MsvcLibX/include/error.h rename to deps/MsvcLibX/include/msvcError.h index e8edad7c67..9a0a790a9a 100644 --- a/deps/MsvcLibX/include/error.h +++ b/deps/MsvcLibX/include/msvcError.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: error.h * * * @@ -11,7 +11,7 @@ * History: * * 2012-10-21 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/fadvise.h b/deps/MsvcLibX/include/msvcFadvise.h similarity index 85% rename from deps/MsvcLibX/include/fadvise.h rename to deps/MsvcLibX/include/msvcFadvise.h index 37d4c310f0..89600ebd05 100644 --- a/deps/MsvcLibX/include/fadvise.h +++ b/deps/MsvcLibX/include/msvcFadvise.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fadvise.h * * * @@ -10,7 +10,7 @@ * History: * * 2012-10-17 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/fcntl.h b/deps/MsvcLibX/include/msvcFcntl.h similarity index 82% rename from deps/MsvcLibX/include/fcntl.h rename to deps/MsvcLibX/include/msvcFcntl.h index 735287c0d4..fc981b5fc9 100644 --- a/deps/MsvcLibX/include/fcntl.h +++ b/deps/MsvcLibX/include/msvcFcntl.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fcntl.h * * * @@ -9,7 +9,7 @@ * History: * * 2017-02-16 JFL Created this file. * * * -* © Copyright 2017 Hewlett Packard Enterprise Development LP * +* Copyright 2017 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,7 +18,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(fcntl.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ /* Microsoft defines _open() in io.h */ #include diff --git a/deps/MsvcLibX/include/fnmatch.h b/deps/MsvcLibX/include/msvcFnmatch.h similarity index 89% rename from deps/MsvcLibX/include/fnmatch.h rename to deps/MsvcLibX/include/msvcFnmatch.h index b41a2b5305..4b7d15b2e8 100644 --- a/deps/MsvcLibX/include/fnmatch.h +++ b/deps/MsvcLibX/include/msvcFnmatch.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fnmatch.h * * * @@ -10,7 +10,7 @@ * History: * * 2012-01-17 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/getopt.h b/deps/MsvcLibX/include/msvcGetopt.h similarity index 96% rename from deps/MsvcLibX/include/getopt.h rename to deps/MsvcLibX/include/msvcGetopt.h index ad4b2f2baa..fa0d75b3ff 100644 --- a/deps/MsvcLibX/include/getopt.h +++ b/deps/MsvcLibX/include/msvcGetopt.h @@ -1,4 +1,4 @@ -/*- +/*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * diff --git a/deps/MsvcLibX/include/iconv.h b/deps/MsvcLibX/include/msvcIconv.h similarity index 87% rename from deps/MsvcLibX/include/iconv.h rename to deps/MsvcLibX/include/msvcIconv.h index 396296fb53..8ad5e2f67f 100644 --- a/deps/MsvcLibX/include/iconv.h +++ b/deps/MsvcLibX/include/msvcIconv.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename iconv.h * * * @@ -10,7 +10,7 @@ * History: * * 2014-02-27 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/inttypes.h b/deps/MsvcLibX/include/msvcInttypes.h similarity index 94% rename from deps/MsvcLibX/include/inttypes.h rename to deps/MsvcLibX/include/msvcInttypes.h index 51740fade3..addc380ed0 100644 --- a/deps/MsvcLibX/include/inttypes.h +++ b/deps/MsvcLibX/include/msvcInttypes.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename inttypes.h * * * @@ -10,7 +10,7 @@ * 2014-02-07 JFL Added definitions for PRIdMAX and PRIiMAX. * * 2016-01-07 JFL Restructured and improved support for MS-DOS. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/libgen.h b/deps/MsvcLibX/include/msvcLibgen.h similarity index 83% rename from deps/MsvcLibX/include/libgen.h rename to deps/MsvcLibX/include/msvcLibgen.h index f7ce9feff4..c3051a2fb2 100644 --- a/deps/MsvcLibX/include/libgen.h +++ b/deps/MsvcLibX/include/msvcLibgen.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: libgen.h * * * @@ -9,7 +9,7 @@ * History: * * 2016-09-08 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/limits.h b/deps/MsvcLibX/include/msvcLimits.h similarity index 87% rename from deps/MsvcLibX/include/limits.h rename to deps/MsvcLibX/include/msvcLimits.h index d4a9e09d5e..496fe9f24c 100644 --- a/deps/MsvcLibX/include/limits.h +++ b/deps/MsvcLibX/include/msvcLimits.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: limits.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-30 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,7 +18,7 @@ #include "msvclibx.h" -#include MSVC_INCLUDE_FILE(limits.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ /************************ MS-DOS-specific definitions ************************/ diff --git a/deps/MsvcLibX/include/netdb.h b/deps/MsvcLibX/include/msvcNetdb.h similarity index 86% rename from deps/MsvcLibX/include/netdb.h rename to deps/MsvcLibX/include/msvcNetdb.h index 417150afc8..cc874580e1 100644 --- a/deps/MsvcLibX/include/netdb.h +++ b/deps/MsvcLibX/include/msvcNetdb.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: netdb.h * * * @@ -9,7 +9,7 @@ * History: * * 2012-01-24 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/process.h b/deps/MsvcLibX/include/msvcProcess.h similarity index 82% rename from deps/MsvcLibX/include/process.h rename to deps/MsvcLibX/include/msvcProcess.h index 105b71669b..66cf94de14 100644 --- a/deps/MsvcLibX/include/process.h +++ b/deps/MsvcLibX/include/msvcProcess.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: process.h * * * @@ -10,7 +10,7 @@ * 2014-03-27 JFL Created this file. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,7 +19,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(process.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #if defined(_WIN32) extern intptr_t _spawnvpU(int iMode, const char *pszCommand, char *const *argv); diff --git a/deps/MsvcLibX/include/regex.h b/deps/MsvcLibX/include/msvcRegex.h similarity index 95% rename from deps/MsvcLibX/include/regex.h rename to deps/MsvcLibX/include/msvcRegex.h index 82158c7b2e..66dd78fbc3 100644 --- a/deps/MsvcLibX/include/regex.h +++ b/deps/MsvcLibX/include/msvcRegex.h @@ -1,4 +1,4 @@ -#ifndef _HSREGEX_H_ +#ifndef _HSREGEX_H_ #define _HSREGEX_H_ #ifndef _HSREGEX_H #define _HSREGEX_H /* never again */ diff --git a/deps/MsvcLibX/include/reparsept.h b/deps/MsvcLibX/include/msvcReparsept.h similarity index 94% rename from deps/MsvcLibX/include/reparsept.h rename to deps/MsvcLibX/include/msvcReparsept.h index 1f2f7bea0c..04ba02f9a2 100644 --- a/deps/MsvcLibX/include/reparsept.h +++ b/deps/MsvcLibX/include/msvcReparsept.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: reparsept.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-28 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/stdbool.h b/deps/MsvcLibX/include/msvcStdbool.h similarity index 83% rename from deps/MsvcLibX/include/stdbool.h rename to deps/MsvcLibX/include/msvcStdbool.h index 4697fd5255..85b42c6585 100644 --- a/deps/MsvcLibX/include/stdbool.h +++ b/deps/MsvcLibX/include/msvcStdbool.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stdbool.h * * * @@ -9,7 +9,7 @@ * History: * * 2012-10-17 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/stdint.h b/deps/MsvcLibX/include/msvcStdint.h similarity index 96% rename from deps/MsvcLibX/include/stdint.h rename to deps/MsvcLibX/include/msvcStdint.h index db321df86a..55b75fe46f 100644 --- a/deps/MsvcLibX/include/stdint.h +++ b/deps/MsvcLibX/include/msvcStdint.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename stdint.h * * * diff --git a/deps/MsvcLibX/include/stdio.h b/deps/MsvcLibX/include/msvcStdio.h similarity index 91% rename from deps/MsvcLibX/include/stdio.h rename to deps/MsvcLibX/include/msvcStdio.h index e819d13189..65af04340d 100644 --- a/deps/MsvcLibX/include/stdio.h +++ b/deps/MsvcLibX/include/msvcStdio.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stdio.h * * * @@ -11,7 +11,7 @@ * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * 2015-12-09 JFL Alias fputs to fputsU, and vfprintf to vfprintfU. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(stdio.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #include diff --git a/deps/MsvcLibX/include/stdlib.h b/deps/MsvcLibX/include/msvcStdlib.h similarity index 84% rename from deps/MsvcLibX/include/stdlib.h rename to deps/MsvcLibX/include/msvcStdlib.h index 110641d427..b9bcc83f2d 100644 --- a/deps/MsvcLibX/include/stdlib.h +++ b/deps/MsvcLibX/include/msvcStdlib.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stdlib.h * * * @@ -9,7 +9,7 @@ * History: * * 2016-09-13 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,7 +18,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(stdlib.h) /* Include MSVC's own file */ +#include /* Include MSVC's own file */ #ifdef __cplusplus extern "C" { diff --git a/deps/MsvcLibX/include/msvcSystem.h b/deps/MsvcLibX/include/msvcSystem.h new file mode 100644 index 0000000000..59c875b114 --- /dev/null +++ b/deps/MsvcLibX/include/msvcSystem.h @@ -0,0 +1,2 @@ +/* CoreUtils global system configuration definitions */ + diff --git a/deps/MsvcLibX/include/time.h b/deps/MsvcLibX/include/msvcTime.h similarity index 78% rename from deps/MsvcLibX/include/time.h rename to deps/MsvcLibX/include/msvcTime.h index f95ec6ddfa..1897da5857 100644 --- a/deps/MsvcLibX/include/time.h +++ b/deps/MsvcLibX/include/msvcTime.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: time.h * * * @@ -10,7 +10,7 @@ * 2014-06-04 JFL Created this file. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,8 +19,8 @@ #include "msvclibx.h" -#include WINSDK_INCLUDE_FILE(winsock2.h) -#include UCRT_INCLUDE_FILE(time.h) /* Include MSVC's own file */ +#include +#include /* Include MSVC's own 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 */ diff --git a/deps/MsvcLibX/include/unistd.h b/deps/MsvcLibX/include/msvcUnistd.h similarity index 95% rename from deps/MsvcLibX/include/unistd.h rename to deps/MsvcLibX/include/msvcUnistd.h index 748de62d24..9ad60625e0 100644 --- a/deps/MsvcLibX/include/unistd.h +++ b/deps/MsvcLibX/include/msvcUnistd.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: unistd.h * * * @@ -18,7 +18,7 @@ * 2014-06-30 JFL Moved PATH_MAX definition to limits.h. * * 2016-08-25 JFL Implemented ResolveLinksA(). * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -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 /* For functions like _chdir() and _getcwd() */ #include /* For _getpid() */ diff --git a/deps/MsvcLibX/include/utime.h b/deps/MsvcLibX/include/msvcUtime.h similarity index 91% rename from deps/MsvcLibX/include/utime.h rename to deps/MsvcLibX/include/msvcUtime.h index e6771fa7a8..ec84687167 100644 --- a/deps/MsvcLibX/include/utime.h +++ b/deps/MsvcLibX/include/msvcUtime.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: utime.h * * * @@ -11,7 +11,7 @@ * History: * * 2014-12-13 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/windows.h b/deps/MsvcLibX/include/msvcWindows.h similarity index 86% rename from deps/MsvcLibX/include/windows.h rename to deps/MsvcLibX/include/msvcWindows.h index 03404d7653..1c2d72554b 100644 --- a/deps/MsvcLibX/include/windows.h +++ b/deps/MsvcLibX/include/msvcWindows.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: windows.h * * * @@ -9,7 +9,7 @@ * History: * * 2016-09-12 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #ifdef _WIN32 -#include WINSDK_INCLUDE_FILE(windows.h) /* Include Windows SDK's own windows.h */ +#include /* Include Windows SDK's own windows.h */ /****************** Define UTF-8 versions of WIN32 routines ******************/ diff --git a/deps/MsvcLibX/include/xfreopen.h b/deps/MsvcLibX/include/msvcXfreopen.h similarity index 83% rename from deps/MsvcLibX/include/xfreopen.h rename to deps/MsvcLibX/include/msvcXfreopen.h index 9ec6e493e9..89fb542564 100644 --- a/deps/MsvcLibX/include/xfreopen.h +++ b/deps/MsvcLibX/include/msvcXfreopen.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: error.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-10 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/msvclibx.h b/deps/MsvcLibX/include/msvclibx.h index 6395737f4b..4f5fc2733b 100644 --- a/deps/MsvcLibX/include/msvclibx.h +++ b/deps/MsvcLibX/include/msvclibx.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename MsvcLibX.h * * * @@ -15,7 +15,7 @@ * 2016-09-28 JFL Can also be included by MS' Resource Compiler. * * 2017-02-05 JFL Changed the UTF-8 programs initialization method. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -58,7 +58,7 @@ /* Generate the OS-and-debug-mode-specific library name */ #define _MSVCLIBX_LIB "MsvcLibX" _MSVCLIBX_LIB_OS_SUFFIX _MSVCLIBX_LIB_DBG_SUFFIX ".lib" -#pragma message("Adding pragma comment(lib, \"" _MSVCLIBX_LIB "\")") +//#pragma message("Adding pragma comment(lib, \"" _MSVCLIBX_LIB "\")") #pragma comment(lib, _MSVCLIBX_LIB) /* Library-specific routine used internally by many standard routines */ diff --git a/deps/MsvcLibX/include/stdio--.h b/deps/MsvcLibX/include/stdio--.h deleted file mode 100644 index 66b7e6e326..0000000000 --- a/deps/MsvcLibX/include/stdio--.h +++ /dev/null @@ -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 diff --git a/deps/MsvcLibX/include/sys/param.h b/deps/MsvcLibX/include/sys/msvcParam.h similarity index 85% rename from deps/MsvcLibX/include/sys/param.h rename to deps/MsvcLibX/include/sys/msvcParam.h index ebb0430fc9..096af578cd 100644 --- a/deps/MsvcLibX/include/sys/param.h +++ b/deps/MsvcLibX/include/sys/msvcParam.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename sys/param.h * * * @@ -9,7 +9,7 @@ * History * * 2014-06-10 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/sys/stat.h b/deps/MsvcLibX/include/sys/msvcStat.h similarity index 95% rename from deps/MsvcLibX/include/sys/stat.h rename to deps/MsvcLibX/include/sys/msvcStat.h index 2cbe715148..b2b82d0be8 100644 --- a/deps/MsvcLibX/include/sys/stat.h +++ b/deps/MsvcLibX/include/sys/msvcStat.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: stat.h * * * @@ -19,7 +19,7 @@ * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * 2016-09-15 JFL Fixed a warning in Visual Studio 2015. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -28,11 +28,11 @@ #include "msvclibx.h" -#include -#include UCRT_INCLUDE_FILE(sys\stat.h) /* Include MSVC's own file */ -#include /* For dirent2stat() arguments definitions */ -#include /* for time_t definition */ -#include /* for timespec definition */ +#include "sys/msvcTypes.h" +#include /* Include MSVC's own 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 override, to avoid conflict with the standard mkdir defined here, should be manually included later on in the C source */ #include @@ -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 */ diff --git a/deps/MsvcLibX/include/sys/time.h b/deps/MsvcLibX/include/sys/msvcTime.h similarity index 94% rename from deps/MsvcLibX/include/sys/time.h rename to deps/MsvcLibX/include/sys/msvcTime.h index 2dd8f4a5e4..d538f6aa76 100644 --- a/deps/MsvcLibX/include/sys/time.h +++ b/deps/MsvcLibX/include/sys/msvcTime.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename sys/time.h * * * @@ -21,7 +21,7 @@ * Added macros TIMEVAL_TO_TIMESPEC & TIMESPEC_TO_TIMEVAL. * * 2016-07-06 JFL Avoid error if winsocks2.h has been previously included. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/sys/utsname.h b/deps/MsvcLibX/include/sys/msvcTsname.h similarity index 86% rename from deps/MsvcLibX/include/sys/utsname.h rename to deps/MsvcLibX/include/sys/msvcTsname.h index 4b2a85527f..41d97a3719 100644 --- a/deps/MsvcLibX/include/sys/utsname.h +++ b/deps/MsvcLibX/include/sys/msvcTsname.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: sys/utsname.h * * * @@ -9,7 +9,7 @@ * History: * * 2014-05-30 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/include/sys/types.h b/deps/MsvcLibX/include/sys/msvcTypes.h similarity index 89% rename from deps/MsvcLibX/include/sys/types.h rename to deps/MsvcLibX/include/sys/msvcTypes.h index 5b0f413322..bde2ac9a8a 100644 --- a/deps/MsvcLibX/include/sys/types.h +++ b/deps/MsvcLibX/include/sys/msvcTypes.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: sys/types.h * * * @@ -11,7 +11,7 @@ * 2014-06-06 JFL Moved mode_t & off*_t definitions here, from sys\stat.h. * * 2015-11-15 JFL Visual Studio 2015 moved this file to the Windows Kit UCRT. * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #include "msvclibx.h" -#include UCRT_INCLUDE_FILE(sys\types.h) /* Include MSVC's own file */ +#include /* Include MSVC's own 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 */ diff --git a/deps/MsvcLibX/include/system.h b/deps/MsvcLibX/include/system.h deleted file mode 100644 index 56f102c33d..0000000000 --- a/deps/MsvcLibX/include/system.h +++ /dev/null @@ -1,2 +0,0 @@ -/* CoreUtils global system configuration definitions */ - diff --git a/deps/MsvcLibX/make.bat b/deps/MsvcLibX/make.bat deleted file mode 100644 index 7a27256122..0000000000 --- a/deps/MsvcLibX/make.bat +++ /dev/null @@ -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" %* diff --git a/deps/MsvcLibX/src/Files.mak b/deps/MsvcLibX/src/Files.mak deleted file mode 100644 index 0b9ad8ee8c..0000000000 --- a/deps/MsvcLibX/src/Files.mak +++ /dev/null @@ -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 - diff --git a/deps/MsvcLibX/src/GetFileAttributes.c b/deps/MsvcLibX/src/GetFileAttributes.c index 8bf3a53e86..386114ed70 100644 --- a/deps/MsvcLibX/src/GetFileAttributes.c +++ b/deps/MsvcLibX/src/GetFileAttributes.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetFileAttributes.c * * * @@ -9,14 +9,14 @@ * History: * * 2016-09-12 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include +#include "msvcLimits.h" /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/GetFileAttributesEx.c b/deps/MsvcLibX/src/GetFileAttributesEx.c index c24664e8fa..caf3c27342 100644 --- a/deps/MsvcLibX/src/GetFileAttributesEx.c +++ b/deps/MsvcLibX/src/GetFileAttributesEx.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetFileAttributesEx.c * * * @@ -9,14 +9,14 @@ * History: * * 2016-09-12 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include +#include "msvcLimits.h" /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/GetFullPathName.c b/deps/MsvcLibX/src/GetFullPathName.c index 2f87f36fdf..4e9afeec3e 100644 --- a/deps/MsvcLibX/src/GetFullPathName.c +++ b/deps/MsvcLibX/src/GetFullPathName.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetFullPathName.c * * * @@ -9,15 +9,15 @@ * History: * * 2016-09-12 JFL Created this file, from the routine in truename.c. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include -#include "debugm.h" /* MsvcLibX debugging macros */ +#include "msvcLimits.h" +#include "msvcDebugm.h" /* MsvcLibX debugging macros */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/GetLongPathName.c b/deps/MsvcLibX/src/GetLongPathName.c index 58a10b616e..b0bbc245d9 100644 --- a/deps/MsvcLibX/src/GetLongPathName.c +++ b/deps/MsvcLibX/src/GetLongPathName.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename GetLongPathName.c * * * @@ -9,15 +9,15 @@ * History: * * 2016-09-12 JFL Created this file, from the routine in truename.c. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ #include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ -#include -#include "debugm.h" /* MsvcLibX debugging macros */ +#include "msvcLimits.h" +#include "msvcDebugm.h" /* MsvcLibX debugging macros */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/NMakefile b/deps/MsvcLibX/src/NMakefile deleted file mode 100644 index 398576c915..0000000000 --- a/deps/MsvcLibX/src/NMakefile +++ /dev/null @@ -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. -<= 260 characters. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ -#include #include #include +#include "msvcStdio.h" #include "msvclibx.h" -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/basename.c b/deps/MsvcLibX/src/basename.c index f89aa22e1f..c442a40626 100644 --- a/deps/MsvcLibX/src/basename.c +++ b/deps/MsvcLibX/src/basename.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename basename.c * * * @@ -12,7 +12,7 @@ * History * * 2016-09-08 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,11 +20,11 @@ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ 2005 security warnings */ -#include #include #include -#include -#include +#include "msvcStdlib.h" +#include "msvcLibgen.h" +#include "msvcLimits.h" #define TRUE 1 #define FALSE 0 diff --git a/deps/MsvcLibX/src/chdir.c b/deps/MsvcLibX/src/chdir.c index 48ab62fe06..8d562f885f 100644 --- a/deps/MsvcLibX/src/chdir.c +++ b/deps/MsvcLibX/src/chdir.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename chdir.c * * * @@ -10,7 +10,7 @@ * 2014-02-28 JFL Created this module. * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,12 +18,14 @@ /* Microsoft C libraries include files */ #include -#include #include /* MsvcLibX library extensions */ -#include -#include -#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) diff --git a/deps/MsvcLibX/src/clock_gettime.c b/deps/MsvcLibX/src/clock_gettime.c index 02202e5d2e..fee7532e2e 100644 --- a/deps/MsvcLibX/src/clock_gettime.c +++ b/deps/MsvcLibX/src/clock_gettime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: clock_gettime.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-04 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -31,8 +31,8 @@ #define WIN32_LEAN_AND_MEAN /* Avoid lots of unnecessary inclusions */ #include - -#include /* 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; diff --git a/deps/MsvcLibX/src/config.DESKTOP-U79TD6T.bat b/deps/MsvcLibX/src/config.DESKTOP-U79TD6T.bat deleted file mode 100644 index 6d57a1358a..0000000000 --- a/deps/MsvcLibX/src/config.DESKTOP-U79TD6T.bat +++ /dev/null @@ -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 diff --git a/deps/MsvcLibX/src/configure.MsvcLibX.bat b/deps/MsvcLibX/src/configure.MsvcLibX.bat deleted file mode 100644 index 767225480a..0000000000 --- a/deps/MsvcLibX/src/configure.MsvcLibX.bat +++ /dev/null @@ -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 diff --git a/deps/MsvcLibX/src/configure.bat b/deps/MsvcLibX/src/configure.bat deleted file mode 100644 index 7037eb92af..0000000000 --- a/deps/MsvcLibX/src/configure.bat +++ /dev/null @@ -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" %* diff --git a/deps/MsvcLibX/src/debugv.c b/deps/MsvcLibX/src/debugv.c index a0a757032c..5d410c1309 100644 --- a/deps/MsvcLibX/src/debugv.c +++ b/deps/MsvcLibX/src/debugv.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: debugv.c * * * @@ -9,11 +9,11 @@ * History: * * 2013-03-27 JFL jf.larvoire@hp.com created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include "debugm.h" +#include "msvcDebugm.h" #if defined(_DEBUG) diff --git a/deps/MsvcLibX/src/dirent.c b/deps/MsvcLibX/src/dirent.c index 5fbf3be6ca..1ab2e9c002 100644 --- a/deps/MsvcLibX/src/dirent.c +++ b/deps/MsvcLibX/src/dirent.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: dirent.c * * * @@ -30,7 +30,7 @@ * 2015-12-14 JFL Bug fix: WIN32 readdirW always read the root on "D:". * * Bug fix: DOS opendir failed on root dirs, like "D:\". * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -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 #include /* MsvcLibX library extensions */ -#include /* For readlink() */ -#include /* 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 */ /*****************************************************************************\ * * diff --git a/deps/MsvcLibX/src/dirname.c b/deps/MsvcLibX/src/dirname.c index 97fffcfe8c..1bdc9d9ba3 100644 --- a/deps/MsvcLibX/src/dirname.c +++ b/deps/MsvcLibX/src/dirname.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename dirname.c * * * @@ -12,7 +12,7 @@ * History * * 2016-09-08 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include "msvcLibgen.h" +#include "msvcLimits.h" #define TRUE 1 #define FALSE 0 diff --git a/deps/MsvcLibX/src/err2errno.c b/deps/MsvcLibX/src/err2errno.c index ec4260df0b..306160f664 100644 --- a/deps/MsvcLibX/src/err2errno.c +++ b/deps/MsvcLibX/src/err2errno.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename err2errno.c * * * @@ -12,7 +12,7 @@ * Removed a few useless special cases, and added EZERO case.* * Make sure the global errno is _not_ changed by this funct.* * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,7 +20,7 @@ #include #include /* 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 diff --git a/deps/MsvcLibX/src/exe b/deps/MsvcLibX/src/exe deleted file mode 100644 index 0afeaf5d6b..0000000000 --- a/deps/MsvcLibX/src/exe +++ /dev/null @@ -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 - diff --git a/deps/MsvcLibX/src/exe.bat b/deps/MsvcLibX/src/exe.bat deleted file mode 100644 index f93d6ba399..0000000000 --- a/deps/MsvcLibX/src/exe.bat +++ /dev/null @@ -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 diff --git a/deps/MsvcLibX/src/filetime.c b/deps/MsvcLibX/src/filetime.c index 7531ba3daa..084b5eef67 100644 --- a/deps/MsvcLibX/src/filetime.c +++ b/deps/MsvcLibX/src/filetime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename filetime.c * * * @@ -9,17 +9,17 @@ * History: * * 2014-02-26 JFL Created this module. * * 2014-03-24 JFL Renamed "statx.h" as the standard . * -* 2014-07-03 JFL Filetime2String: Output time with µs precision if possib. * +* 2014-07-03 JFL Filetime2String: Output time with �s precision if possib. * * 2016-09-13 JFL Fixed a warning. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ -#include /* Define time_t */ -#include +#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 �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�s resolution */ wsprintf(pBuf+19, ".%06d", iFraction); } else if (nBufSize >= 24) { wsprintf(pBuf+19, ".%03d", sTime.wMilliseconds); diff --git a/deps/MsvcLibX/src/fnmatch.c b/deps/MsvcLibX/src/fnmatch.c index 20c2256008..d6f640f4c0 100644 --- a/deps/MsvcLibX/src/fnmatch.c +++ b/deps/MsvcLibX/src/fnmatch.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: fnmatch.c * * * @@ -16,7 +16,7 @@ * 2014-02-28 JFL Added support for UTF-8 pathnames. * * 2014-03-05 JFL In debug mode, hide recursive calls. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -26,8 +26,8 @@ #include #include -#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 diff --git a/deps/MsvcLibX/src/fstat.c b/deps/MsvcLibX/src/fstat.c index ba6a635bb0..124eda8119 100644 --- a/deps/MsvcLibX/src/fstat.c +++ b/deps/MsvcLibX/src/fstat.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fstat.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-24 JFL Created this module. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -21,10 +21,10 @@ #include #include #include -/* MsvcLibX library extensions */ -#include -#include "debugm.h" #include +/* MsvcLibX library extensions */ +#include "sys/msvcStat.h" +#include "msvcDebugm.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/fstat64.c b/deps/MsvcLibX/src/fstat64.c index de6a2c6dcd..5a54962c88 100644 --- a/deps/MsvcLibX/src/fstat64.c +++ b/deps/MsvcLibX/src/fstat64.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fstat64.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-24 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/fstat64i32.c b/deps/MsvcLibX/src/fstat64i32.c index 6275260720..cb1dfd445d 100644 --- a/deps/MsvcLibX/src/fstat64i32.c +++ b/deps/MsvcLibX/src/fstat64i32.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fstat64i32.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-06-24 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/fullpath.c b/deps/MsvcLibX/src/fullpath.c index 8d94d159db..1cc2bf4271 100644 --- a/deps/MsvcLibX/src/fullpath.c +++ b/deps/MsvcLibX/src/fullpath.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename fullpath.c * * * @@ -9,7 +9,7 @@ * History * * 2016-09-13 JFL Created this module with routine from truename.c. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -18,12 +18,12 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ #include -#include #include +#include "msvcLimits.h" #ifdef _WIN32 /* Automatically defined when targeting a Win32 application */ -#include /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ +#include "msvcWindows.h" /* Also includes MsvcLibX' WIN32 UTF-8 extensions */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/getcwd.c b/deps/MsvcLibX/src/getcwd.c index b04127c211..314c59504a 100644 --- a/deps/MsvcLibX/src/getcwd.c +++ b/deps/MsvcLibX/src/getcwd.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename getcwd.c * * * @@ -10,7 +10,7 @@ * 2014-02-28 JFL Created this module. * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -20,8 +20,9 @@ #include #include /* MsvcLibX library extensions */ -#include -#include "debugm.h" +#include "msvcUnistd.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/getopt.c b/deps/MsvcLibX/src/getopt.c index 81976204cc..ba0b2ccb33 100644 --- a/deps/MsvcLibX/src/getopt.c +++ b/deps/MsvcLibX/src/getopt.c @@ -1,4 +1,4 @@ -/*- +/*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * @@ -40,7 +40,7 @@ #include #include #include -#include "getopt.h" +#include "msvcGetopt.h" #ifndef _DIAGASSERT #ifdef NDEBUG diff --git a/deps/MsvcLibX/src/getppid.c b/deps/MsvcLibX/src/getppid.c index 73f66e5144..062beff3b0 100644 --- a/deps/MsvcLibX/src/getppid.c +++ b/deps/MsvcLibX/src/getppid.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename getppid.c * * * @@ -17,11 +17,11 @@ * History: * * 2013-03-27 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include +#include "msvcUnistd.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/gettimeofday.c b/deps/MsvcLibX/src/gettimeofday.c index 9cc548366b..b485edeb9e 100644 --- a/deps/MsvcLibX/src/gettimeofday.c +++ b/deps/MsvcLibX/src/gettimeofday.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename gettimeofday.c * * * @@ -9,14 +9,14 @@ * History * * 2014-06-04 JFL Created this file. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #include "msvclibx.h" -#include -#include +#include "msvcTime.h" +#include "sys/msvcTime.h" #ifdef _MSDOS /* MS-DOS only has a 1-second resolution on system time. diff --git a/deps/MsvcLibX/src/iconv.c b/deps/MsvcLibX/src/iconv.c index b60ed61029..40b6e6462d 100644 --- a/deps/MsvcLibX/src/iconv.c +++ b/deps/MsvcLibX/src/iconv.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename iconv.c * * * @@ -12,7 +12,7 @@ * 2015-12-09 JFL Added routines fputsU and vfprintfU. * * 2016-09-13 JFL Fixed warnings in fputsU. Do not change the input buffer. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -23,8 +23,9 @@ #include #include /* MsvcLibX library extensions */ -#include "iconv.h" -#include "debugm.h" +#include "msvcIconv.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_MSDOS) diff --git a/deps/MsvcLibX/src/lstat.c b/deps/MsvcLibX/src/lstat.c index bd688c13b9..e107fd8706 100644 --- a/deps/MsvcLibX/src/lstat.c +++ b/deps/MsvcLibX/src/lstat.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat.c * * * @@ -17,7 +17,7 @@ * 2014-03-24 JFL Renamed "statx.h" as the standard . * * 2014-06-30 JFL Added support for 32K Unicode paths. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -29,13 +29,14 @@ #include #include #include +#include /* MsvcLibX library extensions */ #include "msvclibx.h" -#include -#include -#include /* For ResolveLinks() definition */ -#include "debugm.h" -#include +#include +#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 */ diff --git a/deps/MsvcLibX/src/lstat32.c b/deps/MsvcLibX/src/lstat32.c index 5486f45b8e..67023ea2bd 100644 --- a/deps/MsvcLibX/src/lstat32.c +++ b/deps/MsvcLibX/src/lstat32.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat32.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/lstat32i64.c b/deps/MsvcLibX/src/lstat32i64.c index 8eafed1d3e..483ff471a2 100644 --- a/deps/MsvcLibX/src/lstat32i64.c +++ b/deps/MsvcLibX/src/lstat32i64.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat32i64.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/lstat64.c b/deps/MsvcLibX/src/lstat64.c index b84b3271e3..56cd0e91a9 100644 --- a/deps/MsvcLibX/src/lstat64.c +++ b/deps/MsvcLibX/src/lstat64.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/lstat64i32.c b/deps/MsvcLibX/src/lstat64i32.c index f5325d1832..6c86979191 100644 --- a/deps/MsvcLibX/src/lstat64i32.c +++ b/deps/MsvcLibX/src/lstat64i32.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename lstat64i32.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-14 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/main.c b/deps/MsvcLibX/src/main.c index 7c87c7fb7e..f366b081ad 100644 --- a/deps/MsvcLibX/src/main.c +++ b/deps/MsvcLibX/src/main.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename main.c * * * @@ -12,20 +12,20 @@ * 2017-02-05 JFL Redesigned to override libc's _setargv(). This avoids * * having to encapsulate the main() routine with one here. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _UTF8_SOURCE #define _CRT_SECURE_NO_WARNINGS /* Avoid depreciation warnings */ -#include #include "msvclibx.h" +#include "msvcStdio.h" #ifdef _WIN32 #include -#include /* For MsvcLibX' codePage global variable */ +#include "msvcIconv.h" /* For MsvcLibX' codePage global variable */ /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/make.bat b/deps/MsvcLibX/src/make.bat deleted file mode 100644 index 7a27256122..0000000000 --- a/deps/MsvcLibX/src/make.bat +++ /dev/null @@ -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" %* diff --git a/deps/MsvcLibX/src/mb2wpath.c b/deps/MsvcLibX/src/mb2wpath.c index a41ff75d94..097d3e7367 100644 --- a/deps/MsvcLibX/src/mb2wpath.c +++ b/deps/MsvcLibX/src/mb2wpath.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mb2wpath.c * * * @@ -10,14 +10,14 @@ * History: * * 2014-07-01 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _UTF8_SOURCE /* Generate the UTF-8 version of printf routines */ #include "msvclibx.h" -#include "debugm.h" +#include "msvcDebugm.h" #if defined(_WIN32) diff --git a/deps/MsvcLibX/src/mkdir.c b/deps/MsvcLibX/src/mkdir.c index e83f4c1773..24e98a52ba 100644 --- a/deps/MsvcLibX/src/mkdir.c +++ b/deps/MsvcLibX/src/mkdir.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mkdir.c * * * @@ -11,7 +11,7 @@ * 2014-03-24 JFL Renamed "statx.h" as the standard . * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -22,8 +22,9 @@ #include /* For _mkdir() */ #include /* MsvcLibX library extensions */ -#include +#include #include "msvclibx.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/mkdtemp.c b/deps/MsvcLibX/src/mkdtemp.c index 602cdd4b55..86bfbf25cf 100644 --- a/deps/MsvcLibX/src/mkdtemp.c +++ b/deps/MsvcLibX/src/mkdtemp.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mkdtemp.c * * * @@ -9,15 +9,15 @@ * History: * * 2014-02-13 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include #include #include #include #include +#include "msvcUnistd.h" char *mkdtemp(char *pszName) { char *pszXXX, *pc; diff --git a/deps/MsvcLibX/src/mkstemp.c b/deps/MsvcLibX/src/mkstemp.c index ab576b6542..f587cff48d 100644 --- a/deps/MsvcLibX/src/mkstemp.c +++ b/deps/MsvcLibX/src/mkstemp.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename mkstemp.c * * * @@ -9,13 +9,13 @@ * History: * * 2014-03-03 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ -#include +#include "msvcUnistd.h" #include #include #include diff --git a/deps/MsvcLibX/src/open.c b/deps/MsvcLibX/src/open.c index 8876ff43eb..dd70409410 100644 --- a/deps/MsvcLibX/src/open.c +++ b/deps/MsvcLibX/src/open.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename open.c * * * @@ -9,7 +9,7 @@ * History: * * 2017-02-16 JFL Created this module. * * * -* © Copyright 2017 Hewlett Packard Enterprise Development LP * +* Copyright 2017 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,8 +19,9 @@ #include #include "msvclibx.h" -#include "fcntl.h" -#include "debugm.h" +#include "msvcFcntl.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/readlink.c b/deps/MsvcLibX/src/readlink.c index d7c728c9fc..4abc91e8e2 100644 --- a/deps/MsvcLibX/src/readlink.c +++ b/deps/MsvcLibX/src/readlink.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename readlink.c * * * @@ -19,7 +19,7 @@ * 2014-07-03 JFL Added support for pathnames >= 260 characters. * * 2016-09-09 JFL Fixed a crash in debug mode, due to stack overflows. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -27,16 +27,17 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ -#include +#include "msvcUnistd.h" #pragma comment(lib, "Mpr.lib") #include -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 #include -#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 */ diff --git a/deps/MsvcLibX/src/realpath.c b/deps/MsvcLibX/src/realpath.c index 8d60c9f554..5fbcf773a2 100644 --- a/deps/MsvcLibX/src/realpath.c +++ b/deps/MsvcLibX/src/realpath.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename realpath.c * * * @@ -23,7 +23,7 @@ * Convert short WIN32 paths to long paths. * * 2016-09-13 JFL Resize output buffers, to avoid wasting lots of memory. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -31,13 +31,15 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ -#include #include #include #include #include /* For _getdcwd() */ #include /* For toupper() */ -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" +#include "msvcUnistd.h" +#include "msvcWindows.h" #define TRUE 1 #define FALSE 0 diff --git a/deps/MsvcLibX/src/spawn.c b/deps/MsvcLibX/src/spawn.c index ab70172b3e..1dede9b712 100644 --- a/deps/MsvcLibX/src/spawn.c +++ b/deps/MsvcLibX/src/spawn.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename spawn.c * * * @@ -10,7 +10,7 @@ * 2014-03-27 JFL Created this module. * * 2014-07-03 JFL Added support for pathnames >= 260 characters. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -19,8 +19,9 @@ /* Microsoft C libraries include files */ #include /* MsvcLibX library extensions */ -#include "debugm.h" +#include "msvcDebugm.h" #include "msvclibx.h" +#include "msvcLimits.h" #ifdef _WIN32 diff --git a/deps/MsvcLibX/src/src2objs.bat b/deps/MsvcLibX/src/src2objs.bat deleted file mode 100644 index b840e308c4..0000000000 --- a/deps/MsvcLibX/src/src2objs.bat +++ /dev/null @@ -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 - diff --git a/deps/MsvcLibX/src/strerror.c b/deps/MsvcLibX/src/strerror.c index 2f8f324829..a10fc45753 100644 --- a/deps/MsvcLibX/src/strerror.c +++ b/deps/MsvcLibX/src/strerror.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename strerror.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-03-06 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/strndup.c b/deps/MsvcLibX/src/strndup.c index 5f68b8e5fc..2c75cb9ed5 100644 --- a/deps/MsvcLibX/src/strndup.c +++ b/deps/MsvcLibX/src/strndup.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename strndup.c * * * @@ -9,7 +9,7 @@ * History: * * 2014-02-13 JFL Created this module. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ diff --git a/deps/MsvcLibX/src/strptime.c b/deps/MsvcLibX/src/strptime.c index 142a2408dd..716b573a34 100644 --- a/deps/MsvcLibX/src/strptime.c +++ b/deps/MsvcLibX/src/strptime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename strptime.c * * * diff --git a/deps/MsvcLibX/src/symlink.c b/deps/MsvcLibX/src/symlink.c index e791cea35a..ce2bbe58a2 100644 --- a/deps/MsvcLibX/src/symlink.c +++ b/deps/MsvcLibX/src/symlink.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename symlink.c * * * @@ -19,7 +19,7 @@ * do not support symlinks. * * 2016-08-25 JFL Fixed two warnings. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -27,17 +27,18 @@ #define _UTF8_SOURCE /* Generate the UTF-8 version of routines */ -#include +#include "msvcUnistd.h" #pragma comment(lib, "Mpr.lib") #include -#include "debugm.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #ifdef _WIN32 #include -#include "reparsept.h" +#include "msvcReparsept.h" /*---------------------------------------------------------------------------*\ * * diff --git a/deps/MsvcLibX/src/uname.c b/deps/MsvcLibX/src/uname.c index 10baef0fe6..afa2ef0d5e 100644 --- a/deps/MsvcLibX/src/uname.c +++ b/deps/MsvcLibX/src/uname.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename: uname.c * * * @@ -17,11 +17,11 @@ * History: * * 2014-05-30 JFL Created this file. * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ -#include "sys/utsname.h" +#include "sys/msvcTsname.h" #include /* For itoa() */ static char major[4] = {0}; diff --git a/deps/MsvcLibX/src/utime.c b/deps/MsvcLibX/src/utime.c index c365ae9f60..cbddfecb01 100644 --- a/deps/MsvcLibX/src/utime.c +++ b/deps/MsvcLibX/src/utime.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename utime.c * * * @@ -13,7 +13,7 @@ * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * 2016-08-25 JFL Added missing routine utimeA(). * * * -* © Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -22,10 +22,10 @@ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ #include -#include /* Must be included before any direct or indirect inclusion */ -#include - -#include "debugm.h" +#include "sys/msvcTime.h" /* Must be included before any direct or indirect inclusion */ +#include "msvcUtime.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_DEBUG) #include @@ -35,7 +35,7 @@ #include #include /* For MSVC's _get_osfhandle() */ -#include /* 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. diff --git a/deps/MsvcLibX/src/utimes.c b/deps/MsvcLibX/src/utimes.c index 482883b87b..9326bb5f74 100644 --- a/deps/MsvcLibX/src/utimes.c +++ b/deps/MsvcLibX/src/utimes.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename utimes.c * * * @@ -14,7 +14,7 @@ * 2014-06-04 JFL Added handling of UTIME_NOW and UTIME_OMIT. * * 2014-07-02 JFL Added support for pathnames >= 260 characters. * * * -* ?Copyright 2016 Hewlett Packard Enterprise Development LP * +* Copyright 2016 Hewlett Packard Enterprise Development LP * * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 * \*****************************************************************************/ @@ -23,10 +23,10 @@ #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ security warnings */ #include -#include /* Must be included before any direct or indirect inclusion */ -#include - -#include "debugm.h" +#include "sys/msvcTime.h" /* Must be included before any direct or indirect inclusion */ +#include "sys/msvcStat.h" +#include "msvcDebugm.h" +#include "msvcLimits.h" #if defined(_DEBUG) #include @@ -36,7 +36,7 @@ #include #include /* For MSVC's _get_osfhandle() */ -#include /* For MsvcLibX's ResolveLinks() */ +#include "msvcUnistd.h" /* For MsvcLibX's ResolveLinks() */ DEBUG_CODE( int Timeval2String(char *buf, size_t bufsize, const struct timeval *tvp) { @@ -64,7 +64,7 @@ void Filetime2Timeval(const FILETIME *pFT, struct timeval *ptv) { ULARGE_INTEGER ull; ull.LowPart = pFT->dwLowDateTime; ull.HighPart = pFT->dwHighDateTime; - ptv->tv_sec = ull.QuadPart / 10000000ULL - 11644473600ULL; + ptv->tv_sec = (long)(ull.QuadPart / 10000000ULL - 11644473600ULL); ptv->tv_usec = (int32_t)((ull.QuadPart % 10000000ULL)/10); } diff --git a/deps/MsvcLibX/src/xfreopen.c b/deps/MsvcLibX/src/xfreopen.c index 724fb8e13b..80311bbac6 100644 --- a/deps/MsvcLibX/src/xfreopen.c +++ b/deps/MsvcLibX/src/xfreopen.c @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/*****************************************************************************\ * * * Filename xfreopen.c * * * @@ -18,7 +18,7 @@ #include #include #include -#include "xfreopen.h" +#include "msvcXfreopen.h" FILE *xfreopen(const char *filename, const char *mode, FILE *stream) { int iMode = 0; diff --git a/deps/iconv/relocatable.c b/deps/iconv/relocatable.c index 79906a399c..5676eb703f 100644 --- a/deps/iconv/relocatable.c +++ b/deps/iconv/relocatable.c @@ -360,7 +360,7 @@ find_shared_library_fullname () ungetc (c, fp); shared_library_fullname = NULL; size = 0; - len = getline (&shared_library_fullname, &size, fp); + len = getline(&shared_library_fullname, &size, fp); if (len >= 0) { /* Success: filled shared_library_fullname. */ diff --git a/deps/pthread/pthread.h b/deps/pthread/pthread.h index e08bf22abc..87673398d0 100644 --- a/deps/pthread/pthread.h +++ b/deps/pthread/pthread.h @@ -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 #else /* NEED_FTIME */ diff --git a/deps/pthread/sched.h b/deps/pthread/sched.h index 8c1096d887..d9bcc2d27f 100644 --- a/deps/pthread/sched.h +++ b/deps/pthread/sched.h @@ -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 -/* Required by Unix 98 */ -# include -# 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 +// /* Required by Unix 98 */ +// # include +// # else +// typedef int pid_t; +// # endif +// #else +// typedef int pid_t; +// #endif +#include /* Thread scheduling policies */ diff --git a/deps/pthread/semaphore.h b/deps/pthread/semaphore.h index ecc29fc33d..9714365b61 100644 --- a/deps/pthread/semaphore.h +++ b/deps/pthread/semaphore.h @@ -99,6 +99,8 @@ #endif #endif /* PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX */ +#include "sys/msvcTypes.h" + #define _POSIX_SEMAPHORES #if defined(__cplusplus) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 2977ed01ec..3390710472 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -912,7 +912,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pSql->cmd.msgType = TSDB_MSG_TYPE_QUERY; pQueryMsg->head.contLen = htonl(msgLen); - assert(msgLen + minMsgSize() <= pCmd->allocSize); + assert(msgLen + minMsgSize() <= (int32_t)pCmd->allocSize); return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c index f740e3cce9..e9f2c1dc1d 100644 --- a/src/client/src/tscSub.c +++ b/src/client/src/tscSub.c @@ -426,7 +426,7 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) { size_t size = taosArrayGetSize(pSub->progress) * sizeof(STableIdInfo); size += sizeof(SQueryTableMsg) + 4096; - tscAllocPayload(&pSql->cmd, size); + tscAllocPayload(&pSql->cmd, (int)size); for (int retry = 0; retry < 3; retry++) { tscRemoveFromSqlList(pSql); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 11add5d47e..1b6d18be0c 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1941,6 +1941,7 @@ int16_t tscGetJoinTagColIdByUid(STagCond* pTagCond, uint64_t uid) { return pTagCond->joinInfo.right.tagColId; } else { assert(0); + return -1; } } diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index c20061d11b..0d7df38b83 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -147,12 +147,12 @@ int32_t tsMonitorInterval = 30; // seconds // internal int32_t tscEmbedded = 0; -char configDir[TSDB_FILENAME_LEN] = "/etc/taos"; +char configDir[TSDB_FILENAME_LEN] = {0}; char tsVnodeDir[TSDB_FILENAME_LEN] = {0}; char tsDnodeDir[TSDB_FILENAME_LEN] = {0}; char tsMnodeDir[TSDB_FILENAME_LEN] = {0}; -char tsDataDir[TSDB_FILENAME_LEN] = "/var/lib/taos"; -char tsScriptDir[TSDB_FILENAME_LEN] = "/etc/taos"; +char tsDataDir[TSDB_FILENAME_LEN] = {0}; +char tsScriptDir[TSDB_FILENAME_LEN] = {0}; char tsVnodeBakDir[TSDB_FILENAME_LEN] = {0}; /* @@ -295,6 +295,7 @@ bool taosCfgDynamicOptions(char *msg) { } static void doInitGlobalConfig(void) { + osInit(); SGlobalCfg cfg = {0}; // ip address diff --git a/src/kit/shell/src/shellDarwin.c b/src/kit/shell/src/shellDarwin.c index 3cb324abe9..ce41827462 100644 --- a/src/kit/shell/src/shellDarwin.c +++ b/src/kit/shell/src/shellDarwin.c @@ -62,7 +62,7 @@ void printHelp() { exit(EXIT_SUCCESS); } -void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { +void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { wordexp_t full_path; for (int i = 1; i < argc; i++) { // for host diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 5d877ba6f0..750335a037 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -577,7 +577,7 @@ static int verticalPrintResult(TAOS_RES* tres) { int maxColNameLen = 0; for (int col = 0; col < num_fields; col++) { - int len = strlen(fields[col].name); + int len = (int)strlen(fields[col].name); if (len > maxColNameLen) { maxColNameLen = len; } @@ -604,9 +604,8 @@ static int verticalPrintResult(TAOS_RES* tres) { return numOfRows; } - static int calcColWidth(TAOS_FIELD* field, int precision) { - int width = strlen(field->name); + int width = (int)strlen(field->name); switch (field->type) { case TSDB_DATA_TYPE_BOOL: @@ -741,7 +740,7 @@ void read_history() { return; } - while ((read_size = getline(&line, &line_size, f)) != -1) { + while ((read_size = taosGetline(&line, &line_size, f)) != -1) { line[read_size - 1] = '\0'; history.hist[history.hend] = strdup(line); @@ -822,7 +821,7 @@ void source_file(TAOS *con, char *fptr) { return; } - while ((read_len = getline(&line, &line_len, f)) != -1) { + while ((read_len = taosGetline(&line, &line_len, f)) != -1) { if (read_len >= tsMaxSQLStringLen) continue; line[--read_len] = '\0'; diff --git a/src/kit/shell/src/shellWindows.c b/src/kit/shell/src/shellWindows.c index 8a7996d682..7297f23931 100644 --- a/src/kit/shell/src/shellWindows.c +++ b/src/kit/shell/src/shellWindows.c @@ -9,12 +9,16 @@ * * ****************************************************************/ -#include "shell.h" #include #include #include +#include "os.h" +#include "shell.h" +#include "taos.h" #include "shellCommand.h" +extern char configDir[]; + void printHelp() { char indent[10] = " "; printf("taos shell is used to test the TDEngine database\n"); @@ -43,7 +47,7 @@ void printHelp() { exit(EXIT_SUCCESS); } -void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { +void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { for (int i = 1; i < argc; i++) { // for host if (strcmp(argv[i], "-h") == 0) { @@ -81,7 +85,7 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) { fprintf(stderr, "config file path: %s overflow max len %d\n", argv[i], TSDB_FILENAME_LEN - 1); exit(EXIT_FAILURE); } - strcpy(configDir, argv[i]); + strcpy(configDir, argv[++i]); } else { fprintf(stderr, "Option -c requires an argument\n"); exit(EXIT_FAILURE); diff --git a/src/kit/taosdemo/CMakeLists.txt b/src/kit/taosdemo/CMakeLists.txt index a13bb767fc..1698c85915 100644 --- a/src/kit/taosdemo/CMakeLists.txt +++ b/src/kit/taosdemo/CMakeLists.txt @@ -13,5 +13,8 @@ IF (TD_LINUX) # ELSE () # TARGET_LINK_LIBRARIES(taosdemo taos_static) # ENDIF () - +ELSEIF (TD_WINDOWS) + AUX_SOURCE_DIRECTORY(. SRC) + ADD_EXECUTABLE(taosdemo ${SRC}) + TARGET_LINK_LIBRARIES(taosdemo taos_static) ENDIF () diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 21e5b963c8..9d46ac5055 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2019 TAOS Data, Inc. * * This program is free software: you can use, redistribute, and/or modify @@ -15,24 +15,31 @@ #define _GNU_SOURCE -#include -#include -#include - -#ifndef _ALPINE -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef LINUX + #include "os.h" + #include + #include + #include + #ifndef _ALPINE + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#else + #include + #include + #include + #include "os.h" +#endif #include "taos.h" #include "tutil.h" @@ -48,32 +55,6 @@ extern char configDir[]; #define STRING_LEN 60000 #define MAX_PREPARED_RAND 1000000 -/* The options we understand. */ -static struct argp_option options[] = { - {0, 'h', "host", 0, "The host to connect to TDEngine. Default is localhost.", 0}, - {0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1}, - {0, 'u', "user", 0, "The TDEngine user name to use when connecting to the server. Default is 'root'.", 2}, - {0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3}, - {0, 'd', "database", 0, "Destination database. Default is 'test'.", 3}, - {0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3}, - {0, 's', "sql file", 0, "The select sql file.", 3}, - {0, 'M', 0, 0, "Use metric flag.", 13}, - {0, 'o', "outputfile", 0, "Direct output to the named file. Default is './output.txt'.", 14}, - {0, 'q', "query_mode", 0, "Query mode--0: SYNC, 1: ASYNC. Default is SYNC.", 6}, - {0, 'b', "type_of_cols", 0, "The data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'.", 7}, - {0, 'w', "length_of_binary", 0, "The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8", 8}, - {0, 'l', "num_of_cols_per_record", 0, "The number of columns per record. Default is 3.", 8}, - {0, 'T', "num_of_threads", 0, "The number of threads. Default is 10.", 9}, - {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 1000.", 10}, - {0, 't', "num_of_tables", 0, "The number of tables. Default is 10000.", 11}, - {0, 'n', "num_of_records_per_table", 0, "The number of records per table. Default is 100000.", 12}, - {0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/taos/'.", 14}, - {0, 'x', 0, 0, "Insert only flag.", 13}, - {0, 'O', "order", 0, "Insert mode--0: In order, 1: Out of order. Default is in order.", 14}, - {0, 'R', "rate", 0, "Out of order data's rate--if order=1 Default 10, min: 0, max: 50.", 14}, - {0, 'D', "delete table", 0, "Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database", 14}, - {0}}; - /* Used by main to communicate with parse_opt. */ typedef struct DemoArguments { char *host; @@ -101,143 +82,337 @@ typedef struct DemoArguments { char **arg_list; } SDemoArguments; -/* Parse a single option. */ -static error_t parse_opt(int key, char *arg, struct argp_state *state) { - /* Get the input argument from argp_parse, which we - know is a pointer to our arguments structure. */ - SDemoArguments *arguments = state->input; - wordexp_t full_path; - char **sptr; - switch (key) { - case 'h': - arguments->host = arg; - break; - case 'p': - arguments->port = atoi(arg); - break; - case 'u': - arguments->user = arg; - break; - case 'P': - arguments->password = arg; - break; - case 'o': - arguments->output_file = arg; - break; - case 's': - arguments->sqlFile = arg; - break; - case 'q': - arguments->mode = atoi(arg); - break; - case 'T': - arguments->num_of_threads = atoi(arg); - break; - case 'r': - arguments->num_of_RPR = atoi(arg); - break; - case 't': - arguments->num_of_tables = atoi(arg); - break; - case 'n': - arguments->num_of_DPT = atoi(arg); - break; - case 'd': - arguments->database = arg; - break; - case 'l': - arguments->num_of_CPR = atoi(arg); - break; - case 'b': - sptr = arguments->datatype; - if (strstr(arg, ",") == NULL) { - if (strcasecmp(arg, "INT") != 0 && strcasecmp(arg, "FLOAT") != 0 && - strcasecmp(arg, "TINYINT") != 0 && strcasecmp(arg, "BOOL") != 0 && - strcasecmp(arg, "SMALLINT") != 0 && - strcasecmp(arg, "BIGINT") != 0 && strcasecmp(arg, "DOUBLE") != 0 && - strcasecmp(arg, "BINARY") && strcasecmp(arg, "NCHAR")) { - argp_error(state, "Invalid data_type!"); - } - sptr[0] = arg; - } else { - int index = 0; - char *dupstr = strdup(arg); - char *running = dupstr; - char *token = strsep(&running, ","); - while (token != NULL) { - if (strcasecmp(token, "INT") != 0 && - strcasecmp(token, "FLOAT") != 0 && - strcasecmp(token, "TINYINT") != 0 && - strcasecmp(token, "BOOL") != 0 && - strcasecmp(token, "SMALLINT") != 0 && - strcasecmp(token, "BIGINT") != 0 && - strcasecmp(token, "DOUBLE") != 0 && strcasecmp(token, "BINARY") && strcasecmp(token, "NCHAR")) { +#ifdef LINUX + /* The options we understand. */ + static struct argp_option options[] = { + {0, 'h', "host", 0, "The host to connect to TDEngine. Default is localhost.", 0}, + {0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1}, + {0, 'u', "user", 0, "The TDEngine user name to use when connecting to the server. Default is 'root'.", 2}, + {0, 'P', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3}, + {0, 'd', "database", 0, "Destination database. Default is 'test'.", 3}, + {0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3}, + {0, 's', "sql file", 0, "The select sql file.", 3}, + {0, 'M', 0, 0, "Use metric flag.", 13}, + {0, 'o', "outputfile", 0, "Direct output to the named file. Default is './output.txt'.", 14}, + {0, 'q', "query_mode", 0, "Query mode--0: SYNC, 1: ASYNC. Default is SYNC.", 6}, + {0, 'b', "type_of_cols", 0, "The data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'.", 7}, + {0, 'w', "length_of_binary", 0, "The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8", 8}, + {0, 'l', "num_of_cols_per_record", 0, "The number of columns per record. Default is 3.", 8}, + {0, 'T', "num_of_threads", 0, "The number of threads. Default is 10.", 9}, + {0, 'r', "num_of_records_per_req", 0, "The number of records per request. Default is 1000.", 10}, + {0, 't', "num_of_tables", 0, "The number of tables. Default is 10000.", 11}, + {0, 'n', "num_of_records_per_table", 0, "The number of records per table. Default is 100000.", 12}, + {0, 'c', "config_directory", 0, "Configuration directory. Default is '/etc/taos/'.", 14}, + {0, 'x', 0, 0, "Insert only flag.", 13}, + {0, 'O', "order", 0, "Insert mode--0: In order, 1: Out of order. Default is in order.", 14}, + {0, 'R', "rate", 0, "Out of order data's rate--if order=1 Default 10, min: 0, max: 50.", 14}, + {0, 'D', "delete table", 0, "Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database", 14}, + {0}}; + + /* Parse a single option. */ + static error_t parse_opt(int key, char *arg, struct argp_state *state) { + /* Get the input argument from argp_parse, which we + know is a pointer to our arguments structure. */ + SDemoArguments *arguments = state->input; + wordexp_t full_path; + char **sptr; + switch (key) { + case 'h': + arguments->host = arg; + break; + case 'p': + arguments->port = atoi(arg); + break; + case 'u': + arguments->user = arg; + break; + case 'P': + arguments->password = arg; + break; + case 'o': + arguments->output_file = arg; + break; + case 's': + arguments->sqlFile = arg; + break; + case 'q': + arguments->mode = atoi(arg); + break; + case 'T': + arguments->num_of_threads = atoi(arg); + break; + case 'r': + arguments->num_of_RPR = atoi(arg); + break; + case 't': + arguments->num_of_tables = atoi(arg); + break; + case 'n': + arguments->num_of_DPT = atoi(arg); + break; + case 'd': + arguments->database = arg; + break; + case 'l': + arguments->num_of_CPR = atoi(arg); + break; + case 'b': + sptr = arguments->datatype; + if (strstr(arg, ",") == NULL) { + if (strcasecmp(arg, "INT") != 0 && strcasecmp(arg, "FLOAT") != 0 && + strcasecmp(arg, "TINYINT") != 0 && strcasecmp(arg, "BOOL") != 0 && + strcasecmp(arg, "SMALLINT") != 0 && + strcasecmp(arg, "BIGINT") != 0 && strcasecmp(arg, "DOUBLE") != 0 && + strcasecmp(arg, "BINARY") && strcasecmp(arg, "NCHAR")) { argp_error(state, "Invalid data_type!"); } - sptr[index++] = token; - token = strsep(&running, ","); - if (index >= MAX_NUM_DATATYPE) break; + sptr[0] = arg; + } else { + int index = 0; + char *dupstr = strdup(arg); + char *running = dupstr; + char *token = strsep(&running, ","); + while (token != NULL) { + if (strcasecmp(token, "INT") != 0 && + strcasecmp(token, "FLOAT") != 0 && + strcasecmp(token, "TINYINT") != 0 && + strcasecmp(token, "BOOL") != 0 && + strcasecmp(token, "SMALLINT") != 0 && + strcasecmp(token, "BIGINT") != 0 && + strcasecmp(token, "DOUBLE") != 0 && strcasecmp(token, "BINARY") && strcasecmp(token, "NCHAR")) { + argp_error(state, "Invalid data_type!"); + } + sptr[index++] = token; + token = strsep(&running, ","); + if (index >= MAX_NUM_DATATYPE) break; + } } - } - break; - case 'w': - arguments->len_of_binary = atoi(arg); - break; - case 'm': - arguments->tb_prefix = arg; - break; - case 'M': - arguments->use_metric = false; - break; - case 'x': - arguments->insert_only = false; - break; - case 'c': - if (wordexp(arg, &full_path, 0) != 0) { - fprintf(stderr, "Invalid path %s\n", arg); - return -1; - } - taos_options(TSDB_OPTION_CONFIGDIR, full_path.we_wordv[0]); - wordfree(&full_path); - break; - case 'O': - arguments->order = atoi(arg); - if (arguments->order > 1 || arguments->order < 0) - { - arguments->order = 0; - } else if (arguments->order == 1) - { - arguments->rate = 10; - } - break; - case 'R': - arguments->rate = atoi(arg); - if (arguments->order == 1 && (arguments->rate > 50 || arguments->rate <= 0)) - { - arguments->rate = 10; - } - break; - case 'D': - arguments->method_of_delete = atoi(arg); - if (arguments->method_of_delete < 0 || arguments->method_of_delete > 3) - { - arguments->method_of_delete = 0; - } - break; - case OPT_ABORT: - arguments->abort = 1; - break; - case ARGP_KEY_ARG: - /*arguments->arg_list = &state->argv[state->next-1]; - state->next = state->argc;*/ - argp_usage(state); - break; + break; + case 'w': + arguments->len_of_binary = atoi(arg); + break; + case 'm': + arguments->tb_prefix = arg; + break; + case 'M': + arguments->use_metric = false; + break; + case 'x': + arguments->insert_only = false; + break; + case 'c': + if (wordexp(arg, &full_path, 0) != 0) { + fprintf(stderr, "Invalid path %s\n", arg); + return -1; + } + taos_options(TSDB_OPTION_CONFIGDIR, full_path.we_wordv[0]); + wordfree(&full_path); + break; + case 'O': + arguments->order = atoi(arg); + if (arguments->order > 1 || arguments->order < 0) + { + arguments->order = 0; + } else if (arguments->order == 1) + { + arguments->rate = 10; + } + break; + case 'R': + arguments->rate = atoi(arg); + if (arguments->order == 1 && (arguments->rate > 50 || arguments->rate <= 0)) + { + arguments->rate = 10; + } + break; + case 'D': + arguments->method_of_delete = atoi(arg); + if (arguments->method_of_delete < 0 || arguments->method_of_delete > 3) + { + arguments->method_of_delete = 0; + } + break; + case OPT_ABORT: + arguments->abort = 1; + break; + case ARGP_KEY_ARG: + /*arguments->arg_list = &state->argv[state->next-1]; + state->next = state->argc;*/ + argp_usage(state); + break; - default: - return ARGP_ERR_UNKNOWN; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; } - return 0; -} + + static struct argp argp = {options, parse_opt, 0, 0}; + + void parse_args(int argc, char *argv[], SDemoArguments *arguments) { + argp_parse(&argp, argc, argv, 0, 0, &arguments); + if (arguments->abort) { + #ifndef _ALPINE + error(10, 0, "ABORTED"); + #else + abort(); + #endif + } + } + +#else + void printHelp() { + char indent[10] = " "; + printf("%s%s\n", indent, "-h"); + printf("%s%s%s\n", indent, indent, "host, The host to connect to TDEngine. Default is localhost."); + printf("%s%s\n", indent, "-p"); + printf("%s%s%s\n", indent, indent, "port, The TCP/IP port number to use for the connection. Default is 0."); + printf("%s%s\n", indent, "-u"); + printf("%s%s%s\n", indent, indent, "user, The TDEngine user name to use when connecting to the server. Default is 'root'."); + printf("%s%s\n", indent, "-p"); + printf("%s%s%s\n", indent, indent, "password, The password to use when connecting to the server. Default is 'taosdata'."); + printf("%s%s\n", indent, "-d"); + printf("%s%s%s\n", indent, indent, "database, Destination database. Default is 'test'."); + printf("%s%s\n", indent, "-m"); + printf("%s%s%s\n", indent, indent, "table_prefix, Table prefix name. Default is 't'."); + printf("%s%s\n", indent, "-s"); + printf("%s%s%s\n", indent, indent, "sql file, The select sql file."); + printf("%s%s\n", indent, "-M"); + printf("%s%s%s\n", indent, indent, "meteric, Use metric flag."); + printf("%s%s\n", indent, "-o"); + printf("%s%s%s\n", indent, indent, "outputfile, Direct output to the named file. Default is './output.txt'."); + printf("%s%s\n", indent, "-q"); + printf("%s%s%s\n", indent, indent, "query_mode, Query mode--0: SYNC, 1: ASYNC. Default is SYNC."); + printf("%s%s\n", indent, "-b"); + printf("%s%s%s\n", indent, indent, "type_of_cols, data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'."); + printf("%s%s\n", indent, "-w"); + printf("%s%s%s\n", indent, indent, "length_of_binary, The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8"); + printf("%s%s\n", indent, "-l"); + printf("%s%s%s\n", indent, indent, "num_of_cols_per_record, The number of columns per record. Default is 3."); + printf("%s%s\n", indent, "-T"); + printf("%s%s%s\n", indent, indent, "num_of_threads, The number of threads. Default is 10."); + printf("%s%s\n", indent, "-r"); + printf("%s%s%s\n", indent, indent, "num_of_records_per_req, The number of records per request. Default is 1000."); + printf("%s%s\n", indent, "-t"); + printf("%s%s%s\n", indent, indent, "num_of_tables, The number of tables. Default is 10000."); + printf("%s%s\n", indent, "-n"); + printf("%s%s%s\n", indent, indent, "num_of_records_per_table, The number of records per table. Default is 100000."); + printf("%s%s\n", indent, "-c"); + printf("%s%s%s\n", indent, indent, "config_directory, Configuration directory. Default is '/etc/taos/'."); + printf("%s%s\n", indent, "-x"); + printf("%s%s%s\n", indent, indent, "flag, Insert only flag."); + printf("%s%s\n", indent, "-O"); + printf("%s%s%s\n", indent, indent, "order, Insert mode--0: In order, 1: Out of order. Default is in order."); + printf("%s%s\n", indent, "-R"); + printf("%s%s%s\n", indent, indent, "rate, Out of order data's rate--if order=1 Default 10, min: 0, max: 50."); + printf("%s%s\n", indent, "-D"); + printf("%s%s%s\n", indent, indent, "Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database."); + } + + void parse_args(int argc, char *argv[], SDemoArguments *arguments) { + char **sptr; + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "-h") == 0) { + arguments->host = argv[++i]; + } else if (strcmp(argv[i], "-p") == 0) { + arguments->port = atoi(argv[++i]); + } else if (strcmp(argv[i], "-u") == 0) { + arguments->user = argv[++i]; + } else if (strcmp(argv[i], "-P") == 0) { + arguments->password = argv[++i]; + } else if (strcmp(argv[i], "-o") == 0) { + arguments->output_file = argv[++i]; + } else if (strcmp(argv[i], "-s") == 0) { + arguments->sqlFile = argv[++i]; + } else if (strcmp(argv[i], "-q") == 0) { + arguments->mode = atoi(argv[++i]); + } else if (strcmp(argv[i], "-T") == 0) { + arguments->num_of_threads = atoi(argv[++i]); + } else if (strcmp(argv[i], "-r") == 0) { + arguments->num_of_RPR = atoi(argv[++i]); + } else if (strcmp(argv[i], "-t") == 0) { + arguments->num_of_tables = atoi(argv[++i]); + } else if (strcmp(argv[i], "-n") == 0) { + arguments->num_of_DPT = atoi(argv[++i]); + } else if (strcmp(argv[i], "-d") == 0) { + arguments->database = argv[++i]; + } else if (strcmp(argv[i], "-l") == 0) { + arguments->num_of_CPR = atoi(argv[++i]); + } else if (strcmp(argv[i], "-b") == 0) { + sptr = arguments->datatype; + ++i; + if (strstr(argv[i], ",") == NULL) { + if (strcasecmp(argv[i], "INT") != 0 && strcasecmp(argv[i], "FLOAT") != 0 && + strcasecmp(argv[i], "TINYINT") != 0 && strcasecmp(argv[i], "BOOL") != 0 && + strcasecmp(argv[i], "SMALLINT") != 0 && + strcasecmp(argv[i], "BIGINT") != 0 && strcasecmp(argv[i], "DOUBLE") != 0 && + strcasecmp(argv[i], "BINARY") && strcasecmp(argv[i], "NCHAR")) { + fprintf(stderr, "Invalid data_type!\n"); + printHelp(); + exit(EXIT_FAILURE); + } + sptr[0] = argv[i]; + } else { + int index = 0; + char *dupstr = strdup(argv[i]); + char *running = dupstr; + char *token = strsep(&running, ","); + while (token != NULL) { + if (strcasecmp(token, "INT") != 0 && + strcasecmp(token, "FLOAT") != 0 && + strcasecmp(token, "TINYINT") != 0 && + strcasecmp(token, "BOOL") != 0 && + strcasecmp(token, "SMALLINT") != 0 && + strcasecmp(token, "BIGINT") != 0 && + strcasecmp(token, "DOUBLE") != 0 && strcasecmp(token, "BINARY") && strcasecmp(token, "NCHAR")) { + fprintf(stderr, "Invalid data_type!\n"); + printHelp(); + exit(EXIT_FAILURE); + } + sptr[index++] = token; + token = strsep(&running, ","); + if (index >= MAX_NUM_DATATYPE) break; + } + } + } else if (strcmp(argv[i], "-w") == 0) { + arguments->len_of_binary = atoi(argv[++i]); + } else if (strcmp(argv[i], "-m") == 0) { + arguments->tb_prefix = argv[++i]; + } else if (strcmp(argv[i], "-M") == 0) { + arguments->use_metric = false; + } else if (strcmp(argv[i], "-x") == 0) { + arguments->insert_only = false; + } else if (strcmp(argv[i], "-c") == 0) { + strcpy(configDir, argv[++i]); + } else if (strcmp(argv[i], "-O") == 0) { + arguments->order = atoi(argv[++i]); + if (arguments->order > 1 || arguments->order < 0) { + arguments->order = 0; + } else if (arguments->order == 1) { + arguments->rate = 10; + } + } else if (strcmp(argv[i], "-R") == 0) { + arguments->rate = atoi(argv[++i]); + if (arguments->order == 1 && (arguments->rate > 50 || arguments->rate <= 0)) { + arguments->rate = 10; + } + } else if (strcmp(argv[i], "-D") == 0) { + arguments->method_of_delete = atoi(argv[++i]); + if (arguments->method_of_delete < 0 || arguments->method_of_delete > 3) { + arguments->method_of_delete = 0; + } + } else if (strcmp(argv[i], "--help") == 0) { + printHelp(); + exit(EXIT_FAILURE); + } else { + fprintf(stderr, "wrong options\n"); + printHelp(); + exit(EXIT_FAILURE); + } + } + } + +#endif /* ******************************* Structure * definition******************************* */ @@ -293,9 +468,6 @@ typedef struct { * variables******************************* */ char *aggreFunc[] = {"*", "count(*)", "avg(f1)", "sum(f1)", "max(f1)", "min(f1)", "first(f1)", "last(f1)"}; -/* ******************************* Global - * functions******************************* */ -static struct argp argp = {options, parse_opt, 0, 0}; void queryDB(TAOS *taos, char *command); @@ -368,15 +540,7 @@ int main(int argc, char *argv[]) { arguments.insert_only = true; // end change - argp_parse(&argp, argc, argv, 0, 0, &arguments); - - if (arguments.abort) { - #ifndef _ALPINE - error(10, 0, "ABORTED"); - #else - abort(); - #endif - } + parse_args(argc, argv, &arguments); enum MODE query_mode = arguments.mode; char *ip_addr = arguments.host; @@ -438,7 +602,7 @@ int main(int argc, char *argv[]) { printf("# Use metric: %s\n", use_metric ? "true" : "false"); printf("# Datatype of Columns: %s\n", dataString); printf("# Binary Length(If applicable): %d\n", - (strcasestr(dataString, "BINARY") != NULL || strcasestr(dataString, "NCHAR") != NULL ) ? len_of_binary : -1); + (strncasecmp(dataString, "BINARY", 6) == 0 || strncasecmp(dataString, "NCHAR", 5) == 0) ? len_of_binary : -1); printf("# Number of Columns per record: %d\n", ncols_per_record); printf("# Number of Threads: %d\n", threads); printf("# Number of Tables: %d\n", ntables); @@ -466,7 +630,7 @@ int main(int argc, char *argv[]) { fprintf(fp, "# Use metric: %s\n", use_metric ? "true" : "false"); fprintf(fp, "# Datatype of Columns: %s\n", dataString); fprintf(fp, "# Binary Length(If applicable): %d\n", - (strcasestr(dataString, "BINARY") != NULL || strcasestr(dataString, "NCHAR") != NULL ) ? len_of_binary : -1); + (strncasecmp(dataString, "BINARY", 6) == 0 || strncasecmp(dataString, "NCHAR", 5) == 0) ? len_of_binary : -1); fprintf(fp, "# Number of Columns per record: %d\n", ncols_per_record); fprintf(fp, "# Number of Threads: %d\n", threads); fprintf(fp, "# Number of Tables: %d\n", ntables); @@ -753,7 +917,7 @@ void querySqlFile(TAOS* taos, char* sqlFile) double t = getCurrentTime(); - while ((read_len = getline(&line, &line_len, fp)) != -1) { + while ((read_len = taosGetline(&line, &line_len, fp)) != -1) { if (read_len >= MAX_SQL_SIZE) continue; line[--read_len] = '\0'; @@ -1035,7 +1199,7 @@ void *syncWrite(void *sarg) { char **data_type = winfo->datatype; int len_of_binary = winfo->len_of_binary; int ncols_per_record = winfo->ncols_per_record; - srand(time(NULL)); + srand((uint32_t)time(NULL)); int64_t time_counter = winfo->start_time; for (int i = 0; i < winfo->nrecords_per_table;) { for (int tID = winfo->start_table_id; tID <= winfo->end_table_id; tID++) { @@ -1049,7 +1213,7 @@ void *syncWrite(void *sarg) { int rand_num = rand() % 100; int len = -1; if (winfo->data_of_order ==1 && rand_num < winfo->data_of_rate) { - long d = tmp_time - rand() % 1000000 + rand_num; + int64_t d = tmp_time - rand() % 1000000 + rand_num; len = generateData(data, data_type, ncols_per_record, d, len_of_binary); } else { len = generateData(data, data_type, ncols_per_record, tmp_time += 1000, len_of_binary); @@ -1144,7 +1308,7 @@ void callBack(void *param, TAOS_RES *res, int code) { int rand_num = rand() % 100; if (tb_info->data_of_order ==1 && rand_num < tb_info->data_of_rate) { - long d = tmp_time - rand() % 1000000 + rand_num; + int64_t d = tmp_time - rand() % 1000000 + rand_num; generateData(data, datatype, ncols_per_record, d, len_of_binary); } else { @@ -1269,13 +1433,15 @@ int32_t generateData(char *res, char **data_type, int num_of_cols, int64_t times bool b = rand() & 1; pstr += sprintf(pstr, ", %s", b ? "true" : "false"); } else if (strcasecmp(data_type[i % c], "binary") == 0) { - char s[len_of_binary]; + char *s = malloc(len_of_binary); rand_string(s, len_of_binary); pstr += sprintf(pstr, ", \"%s\"", s); + free(s); }else if (strcasecmp(data_type[i % c], "nchar") == 0) { - char s[len_of_binary]; + char *s = malloc(len_of_binary); rand_string(s, len_of_binary); pstr += sprintf(pstr, ", \"%s\"", s); + free(s); } if (pstr - res > MAX_DATA_SIZE) { @@ -1286,7 +1452,7 @@ int32_t generateData(char *res, char **data_type, int num_of_cols, int64_t times pstr += sprintf(pstr, ")"); - return pstr - res; + return (int32_t)(pstr - res); } static const char charset[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567890"; diff --git a/src/os/inc/osFile.h b/src/os/inc/osFile.h index e99c64c2e0..dc19c8177c 100644 --- a/src/os/inc/osFile.h +++ b/src/os/inc/osFile.h @@ -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 diff --git a/src/os/inc/osSocket.h b/src/os/inc/osSocket.h index b9be39307c..58f95c3c2d 100644 --- a/src/os/inc/osSocket.h +++ b/src/os/inc/osSocket.h @@ -33,7 +33,11 @@ extern "C" { } \ } typedef int SOCKET; -#endif +#endif + +#ifndef TAOS_OS_DEF_EPOLL + #define TAOS_EPOLL_WAIT_TIME -1 +#endif #define taosClose(x) taosCloseSocket(x) diff --git a/src/os/inc/osWindows.h b/src/os/inc/osWindows.h index bdfb4acb5b..caab61536e 100644 --- a/src/os/inc/osWindows.h +++ b/src/os/inc/osWindows.h @@ -18,9 +18,7 @@ #include #include -#include #include -#include #include #include #include @@ -35,15 +33,18 @@ #include #include #include -#include -#include -#include -#include #include "winsock2.h" #include #include #include -#include +#include +#include +#include "msvcProcess.h" +#include "msvcDirect.h" +#include "msvcFcntl.h" +#include "msvcStdio.h" +#include "sys/msvcStat.h" +#include "sys/msvcTypes.h" #ifdef __cplusplus extern "C" { @@ -93,6 +94,9 @@ extern "C" { typedef SOCKET eventfd_t; #define eventfd(a, b) -1 +#define TAOS_OS_DEF_EPOLL + #define TAOS_EPOLL_WAIT_TIME 100 + #define TAOS_OS_FUNC_STRING_WCHAR int twcslen(const wchar_t *wcs); #define TAOS_OS_FUNC_STRING_GETLINE @@ -126,7 +130,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 +141,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); @@ -146,11 +148,8 @@ char * getpass(const char *prefix); 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 +char * dirname(char *pszPathname); +int gettimeofday(struct timeval *ptv, void *pTimeZone); // for access function in io.h #define F_OK 00 //Existence only diff --git a/src/os/src/alpine/alpineEnv.c b/src/os/src/alpine/alpineEnv.c index 4f84412075..811d98ad7f 100644 --- a/src/os/src/alpine/alpineEnv.c +++ b/src/os/src/alpine/alpineEnv.c @@ -18,7 +18,10 @@ #include "tglobal.h" void osInit() { - strcpy(configDir, "/etc/taos"); + if (configDir[0] == 0) { + strcpy(configDir, "/etc/taos"); + } + strcpy(tsVnodeDir, ""); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); diff --git a/src/os/src/darwin/darwinEnv.c b/src/os/src/darwin/darwinEnv.c index 7e1031a5af..6adebabec0 100644 --- a/src/os/src/darwin/darwinEnv.c +++ b/src/os/src/darwin/darwinEnv.c @@ -18,7 +18,10 @@ #include "tglobal.h" void osInit() { - strcpy(configDir, "~/TDengine/cfg"); + if (configDir[0] == 0) { + strcpy(configDir, "~/TDengine/cfg"); + } + strcpy(tsVnodeDir, ""); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); diff --git a/src/os/src/linux64/linuxEnv.c b/src/os/src/linux64/linuxEnv.c index 4f84412075..811d98ad7f 100644 --- a/src/os/src/linux64/linuxEnv.c +++ b/src/os/src/linux64/linuxEnv.c @@ -18,7 +18,10 @@ #include "tglobal.h" void osInit() { - strcpy(configDir, "/etc/taos"); + if (configDir[0] == 0) { + strcpy(configDir, "/etc/taos"); + } + strcpy(tsVnodeDir, ""); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); diff --git a/src/os/src/windows/CMakeLists.txt b/src/os/src/windows/CMakeLists.txt index 131533c5c5..588d3b7f68 100644 --- a/src/os/src/windows/CMakeLists.txt +++ b/src/os/src/windows/CMakeLists.txt @@ -4,4 +4,4 @@ PROJECT(TDengine) AUX_SOURCE_DIRECTORY(. SRC) ADD_LIBRARY(os ${SRC}) -TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32) +TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32 MsvcLibXw64) diff --git a/src/os/src/windows/w64Env.c b/src/os/src/windows/w64Env.c index 840a8d9f7a..c6046ecae7 100644 --- a/src/os/src/windows/w64Env.c +++ b/src/os/src/windows/w64Env.c @@ -18,8 +18,13 @@ #include "tglobal.h" #include "tulog.h" +extern void taosWinSocketInit(); + void osInit() { - strcpy(configDir, "C:/TDengine/cfg"); + if (configDir[0] == 0) { + strcpy(configDir, "~/TDengine/cfg"); + } + strcpy(tsVnodeDir, "C:/TDengine/data"); strcpy(tsDnodeDir, ""); strcpy(tsMnodeDir, ""); @@ -27,4 +32,5 @@ void osInit() { strcpy(tsLogDir, "C:/TDengine/log"); strcpy(tsScriptDir, "C:/TDengine/script"); strcpy(tsOsName, "Windows"); + taosWinSocketInit(); } \ No newline at end of file diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index 5c910a3311..8ee92be31c 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -38,6 +38,7 @@ static void httpStopThread(HttpThread* pThread) { eventfd_t fd = eventfd(1, 0); if (fd == -1) { httpError("%s, failed to create eventfd, will call pthread_cancel instead, which may result in data corruption: %s", pThread->label, strerror(errno)); + pThread->stop = true; pthread_cancel(pThread->thread); } else if (epoll_ctl(pThread->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) { httpError("%s, failed to call epoll_ctl, will call pthread_cancel instead, which may result in data corruption: %s", pThread->label, strerror(errno)); diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index b9e7ff59e5..e2bee4285f 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -13,5 +13,5 @@ IF (TD_LINUX) TARGET_LINK_LIBRARIES(query tsdb tutil m rt) ADD_SUBDIRECTORY(tests) ELSEIF (TD_WINDOWS) - TARGET_LINK_LIBRARIES(query tutil) + TARGET_LINK_LIBRARIES(query tsdb tutil) ENDIF () diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index ac617edfc3..9da11831e5 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -174,6 +174,7 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) { if (fd == -1) { // failed to create eventfd, call pthread_cancel instead, which may result in data corruption: tError("%s, failed to create eventfd(%s)", pThreadObj->label, strerror(errno)); + pThreadObj->stop = true; pthread_cancel(pThreadObj->thread); } else if (epoll_ctl(pThreadObj->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) { // failed to call epoll_ctl, call pthread_cancel instead, which may result in data corruption: @@ -464,7 +465,7 @@ static void *taosProcessTcpData(void *param) { SRecvInfo recvInfo; while (1) { - int fdNum = epoll_wait(pThreadObj->pollFd, events, maxEvents, -1); + int fdNum = epoll_wait(pThreadObj->pollFd, events, maxEvents, TAOS_EPOLL_WAIT_TIME); if (pThreadObj->stop) { tDebug("%s TCP thread get stop event, exiting...", pThreadObj->label); break; diff --git a/src/sync/src/taosTcpPool.c b/src/sync/src/taosTcpPool.c index 88c2c53be4..b523728bf9 100644 --- a/src/sync/src/taosTcpPool.c +++ b/src/sync/src/taosTcpPool.c @@ -184,7 +184,7 @@ static void *taosProcessTcpData(void *param) { while (1) { if (pThread->stop) break; - int fdNum = epoll_wait(pThread->pollFd, events, maxEvents, -1); + int fdNum = epoll_wait(pThread->pollFd, events, maxEvents, TAOS_EPOLL_WAIT_TIME); if (pThread->stop) { uDebug("%p TCP epoll thread is exiting...", pThread); break; @@ -313,6 +313,7 @@ static void taosStopPoolThread(SThreadObj* pThread) { // failed to create eventfd, call pthread_cancel instead, which may result in data corruption uError("failed to create eventfd(%s)", strerror(errno)); pthread_cancel(pThread->thread); + pThread->stop = true; } else if (epoll_ctl(pThread->pollFd, EPOLL_CTL_ADD, fd, &event) < 0) { // failed to call epoll_ctl, call pthread_cancel instead, which may result in data corruption uError("failed to call epoll_ctl(%s)", strerror(errno)); diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index 8cec7c08e1..ee3bad9835 100644 --- a/src/tsdb/src/tsdbFile.c +++ b/src/tsdb/src/tsdbFile.c @@ -18,6 +18,7 @@ #include "tchecksum.h" #include "tsdbMain.h" #include "tutil.h" + #define TAOS_RANDOM_FILE_FAIL_TEST #ifdef TSDB_IDX @@ -201,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; } } @@ -304,8 +305,8 @@ void tsdbFitRetention(STsdbRepo *pRepo) { STsdbFileH *pFileH = pRepo->tsdbFileH; SFileGroup *pGroup = pFileH->pFGroup; - int mfid = TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - - TSDB_MAX_FILE(pCfg->keep, pCfg->daysPerFile); + int mfid = (int)(TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - + TSDB_MAX_FILE(pCfg->keep, pCfg->daysPerFile)); pthread_rwlock_wrlock(&(pFileH->fhlock)); @@ -370,7 +371,7 @@ void tsdbRemoveFileGroup(STsdbRepo *pRepo, SFileGroup *pFGroup) { SFileGroup fileGroup = *pFGroup; - int nFilesLeft = pFileH->nFGroups - (POINTER_DISTANCE(pFGroup, pFileH->pFGroup) / sizeof(SFileGroup) + 1); + int nFilesLeft = pFileH->nFGroups - (int)(POINTER_DISTANCE(pFGroup, pFileH->pFGroup) / sizeof(SFileGroup) + 1); if (nFilesLeft > 0) { memmove((void *)pFGroup, POINTER_SHIFT(pFGroup, sizeof(SFileGroup)), sizeof(SFileGroup) * nFilesLeft); } diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index 46801d0788..3acad05504 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -211,7 +211,7 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_ char *sdup = strdup(pRepo->rootDir); char *prefix = dirname(sdup); - int prefixLen = strlen(prefix); + int prefixLen = (int)strlen(prefix); taosTFree(sdup); if (name[0] == 0) { // get the file from index or after, but not larger than eindex @@ -232,7 +232,7 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_ fname = strdup(pFGroup->files[(*index) % TSDB_FILE_TYPE_MAX].fname); magic = pFGroup->files[(*index) % TSDB_FILE_TYPE_MAX].info.magic; } else { - if ((pFGroup->fileId + 1) * TSDB_FILE_TYPE_MAX - 1 < eindex) { + if ((pFGroup->fileId + 1) * TSDB_FILE_TYPE_MAX - 1 < (int)eindex) { fname = strdup(pFGroup->files[0].fname); *index = pFGroup->fileId * TSDB_FILE_TYPE_MAX; magic = pFGroup->files[0].info.magic; @@ -327,7 +327,7 @@ void tsdbReportStat(void *repo, int64_t *totalPoints, int64_t *totalStorage, int // ----------------- INTERNAL FUNCTIONS ----------------- char *tsdbGetMetaFileName(char *rootDir) { - int tlen = strlen(rootDir) + strlen(TSDB_META_FILE_NAME) + 2; + int tlen = (int)(strlen(rootDir) + strlen(TSDB_META_FILE_NAME) + 2); char *fname = calloc(1, tlen); if (fname == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -366,7 +366,7 @@ int tsdbUnlockRepo(STsdbRepo *pRepo) { } char *tsdbGetDataDirName(char *rootDir) { - int tlen = strlen(rootDir) + strlen(TSDB_DATA_DIR_NAME) + 2; + int tlen = (int)(strlen(rootDir) + strlen(TSDB_DATA_DIR_NAME) + 2); char *fname = calloc(1, tlen); if (fname == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -627,7 +627,7 @@ _err: } static char *tsdbGetCfgFname(char *rootDir) { - int tlen = strlen(rootDir) + strlen(TSDB_CFG_FILE_NAME) + 2; + int tlen = (int)(strlen(rootDir) + strlen(TSDB_CFG_FILE_NAME) + 2); char *fname = calloc(1, tlen); if (fname == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -853,8 +853,8 @@ static int tsdbAlterKeep(STsdbRepo *pRepo, int32_t keep) { return -1; } - int mfid = TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - - TSDB_MAX_FILE(keep, pCfg->daysPerFile); + int mfid = (int)(TSDB_KEY_FILEID(taosGetTimestamp(pCfg->precision), pCfg->daysPerFile, pCfg->precision) - + TSDB_MAX_FILE(keep, pCfg->daysPerFile)); int i = 0; for (; i < pFileH->nFGroups; i++) { diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index 990db76b7e..02c3ee4d85 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -307,7 +307,7 @@ int tsdbLoadDataFromCache(STable *pTable, SSkipListIterator *pIter, TSKEY maxKey keyNext = tsdbNextIterKey(pIter); if (keyNext < 0 || keyNext > maxKey) return numOfRows; void *ptr = taosbsearch((void *)(&keyNext), (void *)filterKeys, nFilterKeys, sizeof(TSKEY), compTSKEY, TD_GE); - filterIter = (ptr == NULL) ? nFilterKeys : (POINTER_DISTANCE(ptr, filterKeys) / sizeof(TSKEY)); + filterIter = (ptr == NULL) ? nFilterKeys : (int)((POINTER_DISTANCE(ptr, filterKeys) / sizeof(TSKEY))); } do { @@ -364,7 +364,7 @@ static void tsdbFreeBytes(STsdbRepo *pRepo, void *ptr, int bytes) { tsdbTrace("vgId:%d free %d bytes to TSDB buffer pool, nBlocks %d offset %d remain %d", REPO_ID(pRepo), bytes, listNEles(pRepo->mem->bufBlockList), pBufBlock->offset, pBufBlock->remain); } else { - SListNode *pNode = (SListNode *)POINTER_SHIFT(ptr, -sizeof(SListNode)); + SListNode *pNode = (SListNode *)POINTER_SHIFT(ptr, -(int)(sizeof(SListNode))); ASSERT(listTail(pRepo->mem->extraBuffList) == pNode); tdListPopNode(pRepo->mem->extraBuffList, pNode); free(pNode); @@ -495,8 +495,8 @@ static void *tsdbCommitData(void *arg) { goto _exit; } - int sfid = TSDB_KEY_FILEID(pMem->keyFirst, pCfg->daysPerFile, pCfg->precision); - int efid = TSDB_KEY_FILEID(pMem->keyLast, pCfg->daysPerFile, pCfg->precision); + int sfid = (int)(TSDB_KEY_FILEID(pMem->keyFirst, pCfg->daysPerFile, pCfg->precision)); + int efid = (int)(TSDB_KEY_FILEID(pMem->keyLast, pCfg->daysPerFile, pCfg->precision)); // Loop to commit to each file for (int fid = sfid; fid <= efid; fid++) { diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index c0d58f6332..eb1f1fc340 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -443,7 +443,7 @@ STsdbMeta *tsdbNewMeta(STsdbCfg *pCfg) { goto _err; } - pMeta->uidMap = taosHashInit(TSDB_INIT_NTABLES * 1.1, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); + pMeta->uidMap = taosHashInit((size_t)(TSDB_INIT_NTABLES * 1.1), taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false); if (pMeta->uidMap == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; @@ -672,7 +672,7 @@ static STable *tsdbNewTable(STableCfg *pCfg, bool isSuper) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; } - STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->sname, tsize); + STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->sname, (VarDataLenT)tsize); TABLE_UID(pTable) = pCfg->superUid; TABLE_TID(pTable) = -1; TABLE_SUID(pTable) = -1; @@ -690,7 +690,7 @@ static STable *tsdbNewTable(STableCfg *pCfg, bool isSuper) { } pTable->tagVal = NULL; STColumn *pCol = schemaColAt(pTable->tagSchema, DEFAULT_TAG_INDEX_COLUMN); - pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), colBytes(pCol), 1, 0, 1, getTagIndexKey); + pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), 1, 0, 1, getTagIndexKey); if (pTable->pIndex == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; @@ -703,7 +703,7 @@ static STable *tsdbNewTable(STableCfg *pCfg, bool isSuper) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; goto _err; } - STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->name, tsize); + STR_WITH_SIZE_TO_VARSTR(pTable->name, pCfg->name, (VarDataLenT)tsize); TABLE_UID(pTable) = pCfg->tableId.uid; TABLE_TID(pTable) = pCfg->tableId.tid; @@ -1165,7 +1165,7 @@ static void *tsdbDecodeTable(void *buf, STable **pRTable) { buf = tdDecodeSchema(buf, &(pTable->tagSchema)); STColumn *pCol = schemaColAt(pTable->tagSchema, DEFAULT_TAG_INDEX_COLUMN); pTable->pIndex = - tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), colBytes(pCol), 1, 0, 1, getTagIndexKey); + tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), 1, 0, 1, getTagIndexKey); if (pTable->pIndex == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; tsdbFreeTable(pTable); @@ -1191,7 +1191,7 @@ static int tsdbGetTableEncodeSize(int8_t act, STable *pTable) { tlen = sizeof(SListNode) + sizeof(SActObj) + sizeof(SActCont) + tsdbEncodeTable(NULL, pTable) + sizeof(TSCKSUM); } else { if (TABLE_TYPE(pTable) == TSDB_SUPER_TABLE) { - tlen = (sizeof(SListNode) + sizeof(SActObj)) * (tSkipListGetSize(pTable->pIndex) + 1); + tlen = (int)((sizeof(SListNode) + sizeof(SActObj)) * (tSkipListGetSize(pTable->pIndex) + 1)); } else { tlen = sizeof(SListNode) + sizeof(SActObj); } diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index fb79747d30..d63bf8ab78 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -302,7 +302,7 @@ int tsdbCommitTableData(SRWHelper *pHelper, SCommitIter *pCommitIter, SDataCols if (tsdbLoadCompInfo(pHelper, NULL) < 0) return -1; while (true) { - ASSERT(blkIdx <= pIdx->numOfBlocks); + ASSERT(blkIdx <= (int)pIdx->numOfBlocks); TSKEY keyFirst = tsdbNextIterKey(pCommitIter->pIter); if (keyFirst < 0 || keyFirst > maxKey) break; // iter over @@ -405,7 +405,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) { pIdx->tid = pHelper->tableInfo.tid; ASSERT(pIdx->offset >= TSDB_FILE_HEAD_SIZE); - if (taosTWrite(pFile->fd, (void *)(pHelper->pCompInfo), pIdx->len) < pIdx->len) { + if (taosTWrite(pFile->fd, (void *)(pHelper->pCompInfo), pIdx->len) < (int)pIdx->len) { tsdbError("vgId:%d failed to write %d bytes to file %s since %s", REPO_ID(pHelper->pRepo), pIdx->len, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -462,7 +462,7 @@ int tsdbWriteCompIdx(SRWHelper *pHelper) { pFile->info.offset = offset; - if (taosTWrite(pFile->fd, (void *)pHelper->pWIdx, pFile->info.len) < pFile->info.len) { + if (taosTWrite(pFile->fd, (void *)pHelper->pWIdx, pFile->info.len) < (int)pFile->info.len) { tsdbError("vgId:%d failed to write %d bytes to file %s since %s", REPO_ID(pHelper->pRepo), pFile->info.len, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -495,7 +495,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) { return -1; } - if (taosTRead(fd, (void *)(pHelper->pBuffer), pFile->info.len) < pFile->info.len) { + if (taosTRead(fd, (void *)(pHelper->pBuffer), pFile->info.len) < (int)pFile->info.len) { tsdbError("vgId:%d failed to read %d bytes from file %s since %s", REPO_ID(pHelper->pRepo), pFile->info.len, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -512,7 +512,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) { // Decode it pHelper->idxH.numOfIdx = 0; void *ptr = pHelper->pBuffer; - while (POINTER_DISTANCE(ptr, pHelper->pBuffer) < (pFile->info.len - sizeof(TSCKSUM))) { + while (POINTER_DISTANCE(ptr, pHelper->pBuffer) < (int)(pFile->info.len - sizeof(TSCKSUM))) { size_t tlen = taosTSizeof(pHelper->idxH.pIdxArray); pHelper->idxH.numOfIdx++; @@ -535,7 +535,7 @@ int tsdbLoadCompIdx(SRWHelper *pHelper, void *target) { ASSERT(pHelper->idxH.numOfIdx == 1 || pHelper->idxH.pIdxArray[pHelper->idxH.numOfIdx - 1].tid > pHelper->idxH.pIdxArray[pHelper->idxH.numOfIdx - 2].tid); - ASSERT(POINTER_DISTANCE(ptr, pHelper->pBuffer) <= pFile->info.len - sizeof(TSCKSUM)); + ASSERT(POINTER_DISTANCE(ptr, pHelper->pBuffer) <= (int)(pFile->info.len - sizeof(TSCKSUM))); } } } @@ -566,7 +566,7 @@ int tsdbLoadCompInfo(SRWHelper *pHelper, void *target) { } pHelper->pCompInfo = taosTRealloc((void *)pHelper->pCompInfo, pIdx->len); - if (taosTRead(fd, (void *)(pHelper->pCompInfo), pIdx->len) < pIdx->len) { + if (taosTRead(fd, (void *)(pHelper->pCompInfo), pIdx->len) < (int)pIdx->len) { tsdbError("vgId:%d failed to read %d bytes from file %s since %s", REPO_ID(pHelper->pRepo), pIdx->len, helperHeadF(pHelper)->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -594,7 +594,7 @@ int tsdbLoadCompData(SRWHelper *pHelper, SCompBlock *pCompBlock, void *target) { ASSERT(pCompBlock->numOfSubBlocks <= 1); SFile *pFile = (pCompBlock->last) ? helperLastF(pHelper) : helperDataF(pHelper); - if (lseek(pFile->fd, pCompBlock->offset, SEEK_SET) < 0) { + if (lseek(pFile->fd, (off_t)pCompBlock->offset, SEEK_SET) < 0) { tsdbError("vgId:%d failed to lseek file %s since %s", REPO_ID(pHelper->pRepo), pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -614,7 +614,7 @@ int tsdbLoadCompData(SRWHelper *pHelper, SCompBlock *pCompBlock, void *target) { return -1; } - if (!taosCheckChecksumWhole((uint8_t *)pHelper->pCompData, tsize)) { + if (!taosCheckChecksumWhole((uint8_t *)pHelper->pCompData, (uint32_t)tsize)) { tsdbError("vgId:%d file %s is broken, offset %" PRId64 " size %zu", REPO_ID(pHelper->pRepo), pFile->fname, (int64_t)pCompBlock->offset, tsize); terrno = TSDB_CODE_TDB_FILE_CORRUPTED; @@ -787,8 +787,8 @@ static int tsdbWriteBlockToFile(SRWHelper *pHelper, SFile *pFile, SDataCols *pDa } flen = (*(tDataTypeDesc[pDataCol->type].compFunc))((char *)pDataCol->pData, tlen, rowsToWrite, tptr, - taosTSizeof(pHelper->pBuffer) - lsize, pCfg->compression, - pHelper->compBuffer, taosTSizeof(pHelper->compBuffer)); + (int32_t)taosTSizeof(pHelper->pBuffer) - lsize, pCfg->compression, + pHelper->compBuffer, (int32_t)taosTSizeof(pHelper->compBuffer)); } else { flen = tlen; memcpy(tptr, pDataCol->pData, flen); @@ -879,7 +879,7 @@ static int tsdbAdjustInfoSizeIfNeeded(SRWHelper *pHelper, size_t esize) { static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkIdx) { SCompIdx *pIdx = &(pHelper->curCompIdx); - ASSERT(blkIdx >= 0 && blkIdx <= pIdx->numOfBlocks); + ASSERT(blkIdx >= 0 && blkIdx <= (int)pIdx->numOfBlocks); ASSERT(pCompBlock->numOfSubBlocks == 1); // Adjust memory if no more room @@ -887,7 +887,7 @@ static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int if (tsdbAdjustInfoSizeIfNeeded(pHelper, pIdx->len + sizeof(SCompInfo)) < 0) goto _err; // Change the offset - for (int i = 0; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = 0; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = &pHelper->pCompInfo->blocks[i]; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset += sizeof(SCompBlock); } @@ -906,7 +906,7 @@ static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int pIdx->len += sizeof(SCompBlock); ASSERT(pIdx->len <= taosTSizeof(pHelper->pCompInfo)); pIdx->maxKey = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->keyLast; - pIdx->hasLast = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; + pIdx->hasLast = (uint32_t)blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; if (pIdx->numOfBlocks > 1) { ASSERT(pHelper->pCompInfo->blocks[0].keyLast < pHelper->pCompInfo->blocks[1].keyFirst); @@ -925,7 +925,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId ASSERT(pCompBlock->numOfSubBlocks == 0); SCompIdx *pIdx = &(pHelper->curCompIdx); - ASSERT(blkIdx >= 0 && blkIdx < pIdx->numOfBlocks); + ASSERT(blkIdx >= 0 && blkIdx < (int)pIdx->numOfBlocks); SCompBlock *pSCompBlock = pHelper->pCompInfo->blocks + blkIdx; ASSERT(pSCompBlock->numOfSubBlocks >= 1 && pSCompBlock->numOfSubBlocks < TSDB_MAX_SUBBLOCKS); @@ -943,7 +943,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId memmove((void *)((char *)(pHelper->pCompInfo) + pSCompBlock->offset + pSCompBlock->len + sizeof(SCompBlock)), (void *)((char *)(pHelper->pCompInfo) + pSCompBlock->offset + pSCompBlock->len), tsize); - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = &pHelper->pCompInfo->blocks[i]; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset += sizeof(SCompBlock); } @@ -960,7 +960,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId pIdx->len += sizeof(SCompBlock); } else { // Need to create two sub-blocks void *ptr = NULL; - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = pHelper->pCompInfo->blocks + i; if (pTCompBlock->numOfSubBlocks > 1) { ptr = POINTER_SHIFT(pHelper->pCompInfo, pTCompBlock->offset); @@ -973,7 +973,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId size_t tsize = pIdx->len - ((char *)ptr - (char *)(pHelper->pCompInfo)); if (tsize > 0) { memmove(POINTER_SHIFT(ptr, sizeof(SCompBlock) * 2), ptr, tsize); - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = pHelper->pCompInfo->blocks + i; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset += (sizeof(SCompBlock) * 2); } @@ -995,7 +995,7 @@ static int tsdbAddSubBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int blkId } pIdx->maxKey = pHelper->pCompInfo->blocks[pIdx->numOfBlocks - 1].keyLast; - pIdx->hasLast = pHelper->pCompInfo->blocks[pIdx->numOfBlocks - 1].last; + pIdx->hasLast = (uint32_t)pHelper->pCompInfo->blocks[pIdx->numOfBlocks - 1].last; tsdbDebug("vgId:%d tid:%d a subblock is added at index %d", REPO_ID(pHelper->pRepo), pHelper->tableInfo.tid, blkIdx); @@ -1010,7 +1010,7 @@ static int tsdbUpdateSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int SCompIdx *pIdx = &(pHelper->curCompIdx); - ASSERT(blkIdx >= 0 && blkIdx < pIdx->numOfBlocks); + ASSERT(blkIdx >= 0 && blkIdx < (int)pIdx->numOfBlocks); SCompBlock *pSCompBlock = pHelper->pCompInfo->blocks + blkIdx; @@ -1024,7 +1024,7 @@ static int tsdbUpdateSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int POINTER_SHIFT(pHelper->pCompInfo, pSCompBlock->offset + pSCompBlock->len), tsize); } - for (int i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { + for (uint32_t i = blkIdx + 1; i < pIdx->numOfBlocks; i++) { SCompBlock *pTCompBlock = &pHelper->pCompInfo->blocks[i]; if (pTCompBlock->numOfSubBlocks > 1) pTCompBlock->offset -= (sizeof(SCompBlock) * pSCompBlock->numOfSubBlocks); } @@ -1035,7 +1035,7 @@ static int tsdbUpdateSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int *pSCompBlock = *pCompBlock; pIdx->maxKey = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->keyLast; - pIdx->hasLast = blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; + pIdx->hasLast = (uint32_t)blockAtIdx(pHelper, pIdx->numOfBlocks - 1)->last; tsdbDebug("vgId:%d tid:%d a super block is updated at index %d", REPO_ID(pHelper->pRepo), pHelper->tableInfo.tid, blkIdx); @@ -1197,7 +1197,7 @@ static int tsdbLoadColData(SRWHelper *pHelper, SFile *pFile, SCompBlock *pCompBl } int64_t offset = pCompBlock->offset + TSDB_GET_COMPCOL_LEN(pCompBlock->numOfCols) + pCompCol->offset; - if (lseek(pFile->fd, offset, SEEK_SET) < 0) { + if (lseek(pFile->fd, (off_t)offset, SEEK_SET) < 0) { tsdbError("vgId:%d failed to lseek file %s since %s", REPO_ID(pHelper->pRepo), pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -1212,7 +1212,7 @@ static int tsdbLoadColData(SRWHelper *pHelper, SFile *pFile, SCompBlock *pCompBl if (tsdbCheckAndDecodeColumnData(pDataCol, pHelper->pBuffer, pCompCol->len, pCompBlock->algorithm, pCompBlock->numOfRows, pHelper->pRepo->config.maxRowsPerFileBlock, - pHelper->compBuffer, taosTSizeof(pHelper->compBuffer)) < 0) { + pHelper->compBuffer, (int32_t)taosTSizeof(pHelper->compBuffer)) < 0) { tsdbError("vgId:%d file %s is broken at column %d offset %" PRId64, REPO_ID(pHelper->pRepo), pFile->fname, pCompCol->colId, offset); return -1; @@ -1312,7 +1312,7 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa SCompData *pCompData = (SCompData *)pHelper->pBuffer; int fd = pFile->fd; - if (lseek(fd, pCompBlock->offset, SEEK_SET) < 0) { + if (lseek(fd, (off_t)pCompBlock->offset, SEEK_SET) < 0) { tsdbError("vgId:%d tid:%d failed to lseek file %s since %s", REPO_ID(pHelper->pRepo), pHelper->tableInfo.tid, pFile->fname, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); @@ -1375,7 +1375,7 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa } if (tsdbCheckAndDecodeColumnData(pDataCol, (char *)pCompData + tsize + toffset, tlen, pCompBlock->algorithm, pCompBlock->numOfRows, pDataCols->maxPoints, pHelper->compBuffer, - taosTSizeof(pHelper->compBuffer)) < 0) { + (int32_t)taosTSizeof(pHelper->compBuffer)) < 0) { tsdbError("vgId:%d file %s is broken at column %d block offset %" PRId64 " column offset %d", REPO_ID(pHelper->pRepo), pFile->fname, tcolId, (int64_t)pCompBlock->offset, toffset); goto _err; @@ -1499,7 +1499,7 @@ static int tsdbProcessMergeCommit(SRWHelper *pHelper, SCommitIter *pCommitIter, SCompBlock *pCompBlock = taosbsearch((void *)(&keyFirst), (void *)blockAtIdx(pHelper, *blkIdx), pIdx->numOfBlocks - *blkIdx, sizeof(SCompBlock), compareKeyBlock, TD_GE); ASSERT(pCompBlock != NULL); - int tblkIdx = TSDB_GET_COMPBLOCK_IDX(pHelper, pCompBlock); + int tblkIdx = (int32_t)(TSDB_GET_COMPBLOCK_IDX(pHelper, pCompBlock)); if (pCompBlock->last) { ASSERT(pCompBlock->numOfRows < pCfg->minRowsPerFileBlock && tblkIdx == pIdx->numOfBlocks - 1); diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 7fd2e62070..17b0239e3b 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -235,9 +235,10 @@ TsdbQueryHandleT* tsdbQueryTables(TSDB_REPO_T* tsdb, STsdbQueryCond* pCond, STab STableCheckInfo info = { .lastKey = pQueryHandle->window.skey, - .tableId = pTable->tableId, + //.tableId = pTable->tableId, .pTableObj = pTable, }; + info.tableId = pTable->tableId; assert(info.pTableObj != NULL && (info.pTableObj->type == TSDB_NORMAL_TABLE || info.pTableObj->type == TSDB_CHILD_TABLE || info.pTableObj->type == TSDB_STREAM_TABLE)); @@ -523,7 +524,7 @@ static int32_t getFileIdFromKey(TSKEY key, int32_t daysPerFile, int32_t precisio fid = INT32_MAX; } - return fid; + return (int32_t)fid; } static int32_t binarySearchForBlock(SCompBlock* pBlock, int32_t numOfBlocks, TSKEY skey, int32_t order) { @@ -571,7 +572,7 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo continue; // no data blocks in the file belongs to pCheckInfo->pTable } - if (pCheckInfo->compSize < compIndex->len) { + if (pCheckInfo->compSize < (int32_t)compIndex->len) { assert(compIndex->len > 0); char* t = realloc(pCheckInfo->pCompInfo, compIndex->len); @@ -604,7 +605,7 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo } // todo speedup the procedure of located end block - while (end < compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) { + while (end < (int32_t)compIndex->numOfBlocks && (pCompInfo->blocks[end].keyFirst <= e)) { end += 1; } @@ -644,7 +645,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo tdInitDataCols(pQueryHandle->rhelper.pDataCols[1], pSchema); int16_t* colIds = pQueryHandle->defaultLoadColumn->pData; - int32_t ret = tsdbLoadBlockDataCols(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo, colIds, QH_GET_NUM_OF_COLS(pQueryHandle)); + int32_t ret = tsdbLoadBlockDataCols(&(pQueryHandle->rhelper), pBlock, pCheckInfo->pCompInfo, colIds, (int)(QH_GET_NUM_OF_COLS(pQueryHandle))); if (ret == TSDB_CODE_SUCCESS) { SDataBlockLoadInfo* pBlockLoadInfo = &pQueryHandle->dataBlockLoadInfo; @@ -846,7 +847,7 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap return numOfRows; } - int32_t requiredNumOfCols = taosArrayGetSize(pQueryHandle->pColumns); + int32_t requiredNumOfCols = (int32_t)taosArrayGetSize(pQueryHandle->pColumns); //data in buffer has greater timestamp, copy data in file block int32_t i = 0, j = 0; @@ -862,15 +863,15 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap int32_t bytes = pColInfo->info.bytes; if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; } if (pColInfo->info.colId == src->colId) { if (pColInfo->info.type != TSDB_DATA_TYPE_BINARY && pColInfo->info.type != TSDB_DATA_TYPE_NCHAR) { - memmove(pData, src->pData + bytes * start, bytes * num); + memmove(pData, (char*)src->pData + bytes * start, bytes * num); } else { // handle the var-string char* dst = pData; @@ -902,9 +903,9 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap while (i < requiredNumOfCols) { // the remain columns are all null data SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - num) * pColInfo->info.bytes; } if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { @@ -944,13 +945,13 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, } if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; } if (pSchema->columns[j].colId == pColInfo->info.colId) { - void* value = tdGetRowDataOfCol(row, pColInfo->info.type, TD_DATA_ROW_HEAD_SIZE + pSchema->columns[j].offset); + void* value = tdGetRowDataOfCol(row, (int8_t)pColInfo->info.type, TD_DATA_ROW_HEAD_SIZE + pSchema->columns[j].offset); if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { memcpy(pData, value, varDataTLen(value)); } else { @@ -972,9 +973,9 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, while (i < numOfCols) { // the remain columns are all null data SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - pData = pColInfo->pData + numOfRows * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + numOfRows * pColInfo->info.bytes; } else { - pData = pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; + pData = (char*)pColInfo->pData + (capacity - numOfRows - 1) * pColInfo->info.bytes; } if (pColInfo->info.type == TSDB_DATA_TYPE_BINARY || pColInfo->info.type == TSDB_DATA_TYPE_NCHAR) { @@ -997,7 +998,7 @@ static void moveDataToFront(STsdbQueryHandle* pQueryHandle, int32_t numOfRows, i int32_t emptySize = pQueryHandle->outputCapacity - numOfRows; for(int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); - memmove(pColInfo->pData, pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); + memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); } } } @@ -1075,7 +1076,7 @@ static void doMergeTwoLevelData(STsdbQueryHandle* pQueryHandle, STableCheckInfo* int32_t order = (pQueryHandle->order == TSDB_ORDER_ASC)? TSDB_ORDER_DESC:TSDB_ORDER_ASC; int32_t step = ASCENDING_TRAVERSE(pQueryHandle->order)? 1:-1; - int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle); + int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle)); STable* pTable = pCheckInfo->pTableObj; int32_t endPos = cur->pos; @@ -1326,7 +1327,7 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO size_t size = sizeof(STableBlockInfo) * numOfBlocks; if (pQueryHandle->allocSize < size) { - pQueryHandle->allocSize = size; + pQueryHandle->allocSize = (int32_t)size; char* tmp = realloc(pQueryHandle->pDataBlockInfo, pQueryHandle->allocSize); if (tmp == NULL) { return TSDB_CODE_TDB_OUT_OF_MEMORY; @@ -1338,7 +1339,7 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO memset(pQueryHandle->pDataBlockInfo, 0, size); *numOfAllocBlocks = numOfBlocks; - int32_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); + int32_t numOfTables = (int32_t)taosArrayGetSize(pQueryHandle->pTableCheckInfo); SBlockOrderSupporter sup = {0}; sup.numOfTables = numOfTables; @@ -1445,7 +1446,7 @@ static int32_t getDataBlocksInFilesImpl(STsdbQueryHandle* pQueryHandle, bool* ex int32_t code = TSDB_CODE_SUCCESS; int32_t numOfBlocks = 0; - int32_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); + int32_t numOfTables = (int32_t)taosArrayGetSize(pQueryHandle->pTableCheckInfo); STsdbCfg* pCfg = &pQueryHandle->pTsdb->config; STimeWindow win = TSWINDOW_INITIALIZER; @@ -1615,10 +1616,10 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { if (pQueryHandle->cur.win.ekey == pQueryHandle->window.skey) { // data already retrieve, discard other data rows and return - int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle); + int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle)); for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i); - memcpy(pCol->pData, pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows-1), pCol->info.bytes); + memcpy((char*)pCol->pData, (char*)pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows - 1), pCol->info.bytes); } pQueryHandle->cur.win = (STimeWindow){pQueryHandle->window.skey, pQueryHandle->window.skey}; @@ -1646,7 +1647,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { tsdbTakeMemSnapshot(pSecQueryHandle->pTsdb, &pSecQueryHandle->mem, &pSecQueryHandle->imem); // allocate buffer in order to load data blocks from file - int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle); + int32_t numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pQueryHandle)); pSecQueryHandle->statis = calloc(numOfCols, sizeof(SDataStatis)); pSecQueryHandle->pColumns = taosArrayInit(numOfCols, sizeof(SColumnInfoData)); @@ -1669,9 +1670,10 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, j); STableCheckInfo info = { .lastKey = pSecQueryHandle->window.skey, - .tableId = pCheckInfo->tableId, + //.tableId = pCheckInfo->tableId, .pTableObj = pCheckInfo->pTableObj, }; + info.tableId = pCheckInfo->tableId; taosArrayPush(pSecQueryHandle->pTableCheckInfo, &info); } @@ -1688,12 +1690,12 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) { for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i); - memcpy(pCol->pData, pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows-1), pCol->info.bytes); + memcpy((char*)pCol->pData, (char*)pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows - 1), pCol->info.bytes); SColumnInfoData* pCol1 = taosArrayGet(pSecQueryHandle->pColumns, i); assert(pCol->info.colId == pCol1->info.colId); - memcpy(pCol->pData + pCol->info.bytes, pCol1->pData, pCol1->info.bytes); + memcpy((char*)pCol->pData + pCol->info.bytes, pCol1->pData, pCol1->info.bytes); } SColumnInfoData* pTSCol = taosArrayGet(pQueryHandle->pColumns, 0); @@ -1839,7 +1841,7 @@ static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle) { static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int maxRowsToRead, STimeWindow* win, STsdbQueryHandle* pQueryHandle) { int numOfRows = 0; - int32_t numOfCols = taosArrayGetSize(pQueryHandle->pColumns); + int32_t numOfCols = (int32_t)taosArrayGetSize(pQueryHandle->pColumns); win->skey = TSKEY_INITIAL_VAL; int64_t st = taosGetTimestampUs(); @@ -1881,7 +1883,7 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int for(int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pQueryHandle->pColumns, i); - memmove(pColInfo->pData, pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); + memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); } } @@ -1910,7 +1912,7 @@ void tsdbRetrieveDataBlockInfo(TsdbQueryHandleT* pQueryHandle, SDataBlockInfo* p pDataBlockInfo->tid = pTable->tableId.tid; pDataBlockInfo->rows = cur->rows; pDataBlockInfo->window = cur->win; - pDataBlockInfo->numOfCols = QH_GET_NUM_OF_COLS(pHandle); + pDataBlockInfo->numOfCols = (int32_t)(QH_GET_NUM_OF_COLS(pHandle)); } /* @@ -1945,7 +1947,7 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta pHandle->statis[i].colId = colIds[i]; } - tsdbGetDataStatis(&pHandle->rhelper, pHandle->statis, numOfCols); + tsdbGetDataStatis(&pHandle->rhelper, pHandle->statis, (int)numOfCols); // always load the first primary timestamp column data SDataStatis* pPrimaryColStatis = &pHandle->statis[0]; @@ -2010,11 +2012,11 @@ SArray* tsdbRetrieveDataBlock(TsdbQueryHandleT* pQueryHandle, SArray* pIdList) { // if the buffer is not full in case of descending order query, move the data in the front of the buffer if (!ASCENDING_TRAVERSE(pHandle->order) && numOfRows < pHandle->outputCapacity) { int32_t emptySize = pHandle->outputCapacity - numOfRows; - int32_t reqNumOfCols = taosArrayGetSize(pHandle->pColumns); + int32_t reqNumOfCols = (int32_t)taosArrayGetSize(pHandle->pColumns); for(int32_t i = 0; i < reqNumOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pHandle->pColumns, i); - memmove(pColInfo->pData, pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); + memmove((char*)pColInfo->pData, (char*)pColInfo->pData + emptySize * pColInfo->info.bytes, numOfRows * pColInfo->info.bytes); } } @@ -2332,7 +2334,7 @@ int32_t tsdbQuerySTableByTagCond(TSDB_REPO_T* tsdb, uint64_t uid, const char* pT THROW( TSDB_CODE_TDB_OUT_OF_MEMORY ); } expr->nodeType = TSQL_NODE_EXPR; - expr->_node.optr = tagNameRelType; + expr->_node.optr = (uint8_t)tagNameRelType; expr->_node.pLeft = tagExpr; expr->_node.pRight = tbnameExpr; } diff --git a/src/util/inc/tscompression.h b/src/util/inc/tscompression.h index 9398ff8243..bd1ccf3ca5 100644 --- a/src/util/inc/tscompression.h +++ b/src/util/inc/tscompression.h @@ -56,6 +56,7 @@ static FORCE_INLINE int tsCompressTinyint(const char *const input, int inputSize return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -68,6 +69,7 @@ static FORCE_INLINE int tsDecompressTinyint(const char *const input, int compres return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_TINYINT); } else { assert(0); + return -1; } } @@ -80,6 +82,7 @@ static FORCE_INLINE int tsCompressSmallint(const char *const input, int inputSiz return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -92,6 +95,7 @@ static FORCE_INLINE int tsDecompressSmallint(const char *const input, int compre return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_SMALLINT); } else { assert(0); + return -1; } } @@ -104,6 +108,7 @@ static FORCE_INLINE int tsCompressInt(const char *const input, int inputSize, co return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -116,6 +121,7 @@ static FORCE_INLINE int tsDecompressInt(const char *const input, int compressedS return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_INT); } else { assert(0); + return -1; } } @@ -128,6 +134,7 @@ static FORCE_INLINE int tsCompressBigint(const char *const input, int inputSize, return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -140,6 +147,7 @@ static FORCE_INLINE int tsDecompressBigint(const char *const input, int compress return tsDecompressINTImp(buffer, nelements, output, TSDB_DATA_TYPE_BIGINT); } else { assert(0); + return -1; } } @@ -152,6 +160,7 @@ static FORCE_INLINE int tsCompressBool(const char *const input, int inputSize, c return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -164,6 +173,7 @@ static FORCE_INLINE int tsDecompressBool(const char *const input, int compressed return tsDecompressBoolImp(buffer, nelements, output); } else { assert(0); + return -1; } } @@ -186,6 +196,7 @@ static FORCE_INLINE int tsCompressFloat(const char *const input, int inputSize, return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -198,6 +209,7 @@ static FORCE_INLINE int tsDecompressFloat(const char *const input, int compresse return tsDecompressFloatImp(buffer, nelements, output); } else { assert(0); + return -1; } } @@ -210,6 +222,7 @@ static FORCE_INLINE int tsCompressDouble(const char *const input, int inputSize, return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -222,6 +235,7 @@ static FORCE_INLINE int tsDecompressDouble(const char *const input, int compress return tsDecompressDoubleImp(buffer, nelements, output); } else { assert(0); + return -1; } } @@ -234,6 +248,7 @@ static FORCE_INLINE int tsCompressTimestamp(const char *const input, int inputSi return tsCompressStringImp(buffer, len, output, outputSize); } else { assert(0); + return -1; } } @@ -246,6 +261,7 @@ static FORCE_INLINE int tsDecompressTimestamp(const char *const input, int compr return tsDecompressTimestampImp(buffer, nelements, output); } else { assert(0); + return -1; } } diff --git a/src/util/src/tcompression.c b/src/util/src/tcompression.c index c20ba59ac9..8c5828d32d 100644 --- a/src/util/src/tcompression.c +++ b/src/util/src/tcompression.c @@ -591,6 +591,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char } else { assert(0); + return -1; } } /* --------------------------------------------Double Compression diff --git a/tests/script/windows/account/authority.sim b/tests/script/windows/account/authority.sim deleted file mode 100644 index a352faf23b..0000000000 --- a/tests/script/windows/account/authority.sim +++ /dev/null @@ -1,317 +0,0 @@ -sql connect -sleep 3000 - -print ============= step1 - -sql create user read pass 'taosdata' -sql create user write pass 'taosdata' -sql create user manage pass 'taosdata' - -sql create user a PASS 'ade' privilege -x step11 - return -1 -step11: - -sql create user a PASS 'ade' privilege a -x step12 - return -1 -step12: - -sql create user a PASS 'ade' privilege read -x step13 - return -1 -step13: - -sql show users -if $rows != 6 then - return -1 -endi - -sql alter user read privilege read -sql alter user write privilege write -sql alter user manage privilege super - -print ============= step2 -sql close -sql connect write -sleep 2000 - -sql create database d1 -sql create database d2 -sql create table d1.t1 (ts timestamp, i int) -sql create table d2.t2 (ts timestamp, i int) -sql insert into d1.t1 values(now, 1) -sql insert into d2.t2 values(now, 1) -sql insert into d2.t2 values(now+1s, 2) - -sql show users -if $rows != 6 then - return -1 -endi -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql create account t1 pass 'taosdata' -x step21 - return -1 -step21: - -sql create user t1 pass 'taosdata' -x step22 - return -1 -step22: - -sql alter user read pass 'taosdata' -x step23 - return -1 -step23: - -sql create dnode $hostname2 -x step24 - return -1 -step24: - -sql drop dnode $hostname2 -x step25 - return -1 -step25: - -sql create mnode 192.168.0.2 -x step26 - return -1 -step26: - -sql drop mnode 192.168.0.2 -x step27 - return -1 -step27: - -sql drop account root -x step28 - return -1 -step28: - -sql alter user write pass 'taosdata' - -print ============= step3 -sql close -sql connect read -sleep 2000 - -sql create database d3 -x step31 - return -1 -step31: - -sql create table d1.t3 (ts timestamp, i int) -x step32 - return -1 -step32: - -#sql insert into d1.t1 values(now, 2) -x step33 -# return -1 -#step33: - -sql show accounts -if $rows != 1 then - return -1 -endi -sql show users -if $rows != 6 then - return -1 -endi -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql sql create account t1 pass 'taosdata' -x step34 - return -1 -step34: - -sql sql create user t1 pass 'taosdata' -x step35 - return -1 -step35: - -print ============= step4 -sql close -sql connect manage -sleep 2000 - -sql create database d3 -sql create database d4 -sql create table d3.t3 (ts timestamp, i int) -sql create table d4.t4 (ts timestamp, i int) - -sql show accounts -if $rows != 1 then - return -1 -endi -sql show users -if $rows != 6 then - return -1 -endi -sql show databases -if $rows != 4 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql create account other pass 'taosdata' -x step41 - return -1 -step41: - -sql close -sql connect -sleep 2000 -sql create account other pass 'taosdata' - -print ============= step5 -sql close -sql connect other -sleep 2000 -sql create user read pass 'taosdata' -x step51 - return -1 -step51: -sql create other write pass 'taosdata' -x step52 - return -1 -step52: - -sql create user oread pass 'taosdata' -sql create user owrite pass 'taosdata' -sql create user omanage pass 'taosdata' - -sql show users -print show users $rows -if $rows != 5 then - return -1 -endi - -sql alter user oread privilege read -sql alter user owrite privilege write -sql alter user oroot privilege super -x step53 - return -1 -step53: -sql alter user read privilege read -x step54 - return -1 -step54: - -print ============= step6 -sql close -sql connect owrite -sleep 2000 - -sql create database d1 -sql create database d3 -sql create table d1.t1 (ts timestamp, i int) -sql create table d3.t3 (ts timestamp, i int) -sql insert into d1.t1 values(now, 11) -sql insert into d3.t3 values(now, 11) -sql insert into d3.t3 values(now+1s, 12) - -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -x step6 - return -1 -step6: -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql sql create user t1 pass 'taosdata' -x step62 - return -1 -step62: - -print ============= step7 -sql close -sql connect oread -sleep 2000 - -sql create database d7 -x step71 - return -1 -step71: - -sql show databases -if $rows != 2 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -x step72 - return -1 -step72: -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql sql create user t1 pass 'taosdata' -x step74 - return -1 -step74: - -print ============= step8 -sql close -sql connect omanage -sleep 2000 - -sql create database d4 -sql create table d4.t4 (ts timestamp, i int) - -sql show databases -if $rows != 3 then - return -1 -endi -sql select * from d1.t1 -if $rows != 1 then - return -1 -endi -sql select * from d2.t2 -x step82 - return -1 -step82: -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -print ============= step9 -sql close -sql connect -sleep 2000 -sql show databases -if $rows != 4 then - return -1 -endi - -sql drop user read -sql drop user manage -sql drop user write - -sql close -sql connect -sleep 2000 -sql drop database d1 -sql drop database d2 -sql drop database d3 -sql drop database d4 diff --git a/tests/script/windows/account/user_create.sim b/tests/script/windows/account/user_create.sim deleted file mode 100644 index 6dc9ab05b3..0000000000 --- a/tests/script/windows/account/user_create.sim +++ /dev/null @@ -1,80 +0,0 @@ -sql connect -sleep 3000 - -print =============== step1 -sql show users -if $rows != 3 then - return -1 -endi - -sql create user read PASS 'pass123' -sql create user read PASS 'pass123' -x step1 - return -1 -step1: - -sql show users -if $rows != 4 then - return -1 -endi - -sql alter user read PASS 'taosdata' - -print =============== step2 -sql close -sql connect read -sleep 2000 - -sql alter user read PASS 'taosdata' - -print =============== step3 -sql drop user read -x step31 - return -1 -step31: -sql drop user _root -x step32 - return -1 -step32: -sql drop user monitor -x step33 - return -1 -step33: - -print =============== step4 -sql close -sql connect -sleep 2000 - -sql alter user read privilege read -sql show users -if $data1_read != read then - return -1 -endi - -sql alter user read privilege super -sql show users -if $data1_read != super then - return -1 -endi - -sql alter user read privilege write -sql show users -if $data1_read != write then - return -1 -endi - -sql alter user read privilege 1 -x step43 - return -1 -step43: - -sql drop user _root -x step41 - return -1 -step41: - -sql drop user monitor -x step42 - return -1 -step42: - -sql drop user read - - - - - diff --git a/tests/script/windows/account/user_len.sim b/tests/script/windows/account/user_len.sim deleted file mode 100644 index b4a344fe8d..0000000000 --- a/tests/script/windows/account/user_len.sim +++ /dev/null @@ -1,81 +0,0 @@ -sql connect -sleep 3000 - -$i = 0 -$dbPrefix = lm_us_db -$tbPrefix = lm_us_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop user ac -x step0 - return -1 -step0: - -sql create user PASS '123' -x step1 - return -1 -step1: - -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step2 -sql drop user a -x step2 -step2: -sql create user a PASS '123' -sql show users -if $rows != 4 then - return -1 -endi - -sql drop user a -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step3 -sql drop user abc01234567890123456789 -x step3 -step3: - -sql create user abc01234567890123456789 PASS '123' -sql show users -if $rows != 4 then - return -1 -endi - -sql drop user abc01234567890123456789 -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step4 -sql create user abcd0123456789012345678901234567890111 PASS '123' -x step4 - return -1 -step4: -sql show users -if $rows != 3 then - return -1 -endi - -print =============== step5 -sql drop user 123 -x step5 -step5: -sql create user 123 PASS '123' -x step61 - return -1 -step61: - -sql create user a123 PASS '123' -sql show users -if $rows != 4 then - return -1 -endi - -sql drop user a123 -sql show users -if $rows != 3 then - return -1 -endi diff --git a/tests/script/windows/alter/metrics.sim b/tests/script/windows/alter/metrics.sim index 323e150d41..3717d8c1ed 100644 --- a/tests/script/windows/alter/metrics.sim +++ b/tests/script/windows/alter/metrics.sim @@ -35,7 +35,6 @@ endi print ======== step2 sql alter table mt add column b smallint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -64,7 +63,6 @@ endi print ======== step3 sql alter table mt add column c tinyint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -99,7 +97,6 @@ endi print ======== step4 sql alter table mt add column d int -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -140,7 +137,6 @@ endi print ======== step5 sql alter table mt add column e bigint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -187,7 +183,6 @@ endi print ======== step6 sql alter table mt add column f float -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -240,7 +235,6 @@ endi print ======== step7 sql alter table mt add column g double -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -299,7 +293,6 @@ endi print ======== step8 sql alter table mt add column h binary(10) -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -461,7 +454,6 @@ print ======== step11 print ======== step12 sql alter table mt drop column b -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -523,7 +515,6 @@ endi print ======== step13 sql alter table mt drop column c -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -579,7 +570,6 @@ endi print ======== step14 sql alter table mt drop column d -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -629,7 +619,6 @@ endi print ======== step15 sql alter table mt drop column e -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -673,7 +662,6 @@ endi print ======== step16 sql alter table mt drop column f -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -711,7 +699,6 @@ endi print ======== step17 sql alter table mt drop column g -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -743,7 +730,6 @@ endi print ============= step18 sql alter table mt drop column h -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -763,7 +749,7 @@ endi if $data21 != INT then return -1 endi -if $data30 != NULL then +if $data30 != null then return -1 endi diff --git a/tests/script/windows/alter/table.sim b/tests/script/windows/alter/table.sim index e6b5d69551..3b811a065e 100644 --- a/tests/script/windows/alter/table.sim +++ b/tests/script/windows/alter/table.sim @@ -28,7 +28,6 @@ endi print ======== step2 sql alter table tb add column b smallint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -51,7 +50,6 @@ endi print ======== step3 sql alter table tb add column c tinyint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -80,7 +78,6 @@ endi print ======== step4 sql alter table tb add column d int -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -115,7 +112,6 @@ endi print ======== step5 sql alter table tb add column e bigint -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -156,7 +152,6 @@ endi print ======== step6 sql alter table tb add column f float -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -203,7 +198,6 @@ endi print ======== step7 sql alter table tb add column g double -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -256,7 +250,6 @@ endi print ======== step8 sql alter table tb add column h binary(10) -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -406,7 +399,6 @@ step115: print ======== step12 sql alter table tb drop column b -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -462,7 +454,6 @@ endi print ======== step13 sql alter table tb drop column c -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -512,7 +503,6 @@ endi print ======== step14 sql alter table tb drop column d -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -556,7 +546,6 @@ endi print ======== step15 sql alter table tb drop column e -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -594,7 +583,6 @@ endi print ======== step16 sql alter table tb drop column f -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -626,7 +614,6 @@ endi print ======== step17 sql alter table tb drop column g -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -652,7 +639,6 @@ endi print ============= step18 sql alter table tb drop column h -sleep 2500 sql describe tb if $data00 != ts then return -1 @@ -666,7 +652,7 @@ endi if $data11 != INT then return -1 endi -if $data20 != NULL then +if $data20 != null then return -1 endi diff --git a/tests/script/windows/compute/diff.sim b/tests/script/windows/compute/diff.sim index e9d76f8c78..6c2829872a 100644 --- a/tests/script/windows/compute/diff.sim +++ b/tests/script/windows/compute/diff.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_di_db $tbPrefix = m_di_tb diff --git a/tests/script/windows/compute/first.sim b/tests/script/windows/compute/first.sim index 7b6a831004..9a0c02fe4b 100644 --- a/tests/script/windows/compute/first.sim +++ b/tests/script/windows/compute/first.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_fi_db $tbPrefix = m_fi_tb diff --git a/tests/script/windows/compute/interval.sim b/tests/script/windows/compute/interval.sim index d40c6ad0c9..365c6d9d31 100644 --- a/tests/script/windows/compute/interval.sim +++ b/tests/script/windows/compute/interval.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_in_db $tbPrefix = m_in_tb diff --git a/tests/script/windows/compute/last.sim b/tests/script/windows/compute/last.sim index 4b686766ae..aa9699778f 100644 --- a/tests/script/windows/compute/last.sim +++ b/tests/script/windows/compute/last.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_la_db $tbPrefix = m_la_tb diff --git a/tests/script/windows/compute/leastsquare.sim b/tests/script/windows/compute/leastsquare.sim index 81f37c3228..bb7404edd0 100644 --- a/tests/script/windows/compute/leastsquare.sim +++ b/tests/script/windows/compute/leastsquare.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_le_db $tbPrefix = m_le_tb @@ -15,7 +15,7 @@ $mt = $mtPrefix . $i sql drop database $db -x step1 step1: -sql create database $db +sql create database $db keep 36500 sql use $db sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) @@ -43,41 +43,41 @@ $tb = $tbPrefix . $i sql select leastsquares(tbcol, 1, 1) from $tb print ===> $data00 -if $data00 != @(1.000000, 1.000000)@ then +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step3 sql select leastsquares(tbcol, 1, 1) from $tb where ts < now + 4m print ===> $data00 -if $data00 != @(1.000000, 1.000000)@ then +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step4 sql select leastsquares(tbcol, 1, 1) as b from $tb print ===> $data00 -if $data00 != @(1.000000, 1.000000)@ then +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step5 sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m) print ===> $data01 -if $data01 != @(1.000000, 1.000000)@ then +if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) print ===> $data01 -if $data01 != @(1.000000, 1.000000)@ then +if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step6 sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m) print ===> $data01 -if $data01 != @(1.000000, 1.000000)@ then +if $data01 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print ===> $rows @@ -90,4 +90,4 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi diff --git a/tests/script/windows/compute/max.sim b/tests/script/windows/compute/max.sim index 60147358b3..a19d122ecd 100644 --- a/tests/script/windows/compute/max.sim +++ b/tests/script/windows/compute/max.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_ma_db $tbPrefix = m_ma_tb diff --git a/tests/script/windows/compute/min.sim b/tests/script/windows/compute/min.sim index 928404babc..216f2061d7 100644 --- a/tests/script/windows/compute/min.sim +++ b/tests/script/windows/compute/min.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_mi_db $tbPrefix = m_mi_tb diff --git a/tests/script/windows/compute/percentile.sim b/tests/script/windows/compute/percentile.sim index 6068722b54..20b2740d6e 100644 --- a/tests/script/windows/compute/percentile.sim +++ b/tests/script/windows/compute/percentile.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_pe_db $tbPrefix = m_pe_tb diff --git a/tests/script/windows/compute/stddev.sim b/tests/script/windows/compute/stddev.sim index b5ba704bef..c02b3e4ab3 100644 --- a/tests/script/windows/compute/stddev.sim +++ b/tests/script/windows/compute/stddev.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_st_db $tbPrefix = m_st_tb diff --git a/tests/script/windows/compute/sum.sim b/tests/script/windows/compute/sum.sim index 39eb771f34..04af1d457a 100644 --- a/tests/script/windows/compute/sum.sim +++ b/tests/script/windows/compute/sum.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_su_db $tbPrefix = m_su_tb diff --git a/tests/script/windows/compute/top.sim b/tests/script/windows/compute/top.sim index b64c24b03f..b3c698c064 100644 --- a/tests/script/windows/compute/top.sim +++ b/tests/script/windows/compute/top.sim @@ -1,5 +1,5 @@ -sql connect sleep 3000 +sql connect $dbPrefix = m_to_db $tbPrefix = m_to_tb diff --git a/tests/script/windows/db/basic.sim b/tests/script/windows/db/basic.sim index 4222cfe3b2..f1e18d15a5 100644 --- a/tests/script/windows/db/basic.sim +++ b/tests/script/windows/db/basic.sim @@ -1,5 +1,6 @@ -sql connect sleep 3000 +sql connect + print ============================ dnode1 start $i = 0 @@ -9,7 +10,7 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =============== step1 -sql create database $db replica 1 days 20 keep 2000 +sql create database $db replica 1 days 20 keep 2000 cache 16 sql show databases print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 if $data00 != $db then @@ -24,10 +25,10 @@ endi if $data04 != 1 then return -1 endi -if $data05 != 20 then +if $data06 != 20 then return -1 endi -if $data07 != 1000 then +if $data08 != 16 then return -1 endi @@ -46,7 +47,7 @@ if $rows != 0 then endi print =============== step4 -sql drop database $db +sql_error drop database $db print =============== step5 sql create database $db replica 1 days 15 keep 1500 @@ -64,14 +65,10 @@ endi if $data04 != 1 then return -1 endi -if $data05 != 15 then +if $data06 != 15 then return -1 endi -if $data07 != 1000 then - return -1 -endi - print =============== step6 sql use $db sql create table $tb (ts timestamp, speed int) @@ -95,9 +92,7 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i sql create database $db sql use $db -sql create table $tb (ts timestamp, speed int) -x step6 - return -1 -step6: +sql create table $tb (ts timestamp, speed int) print =============== step7 $i = 0 diff --git a/tests/script/windows/db/len.sim b/tests/script/windows/db/len.sim index 32f6476177..f922e7e05a 100644 --- a/tests/script/windows/db/len.sim +++ b/tests/script/windows/db/len.sim @@ -1,8 +1,8 @@ -sql connect sleep 3000 +sql connect print =============== step1 -sql drop database dd +sql_error drop database dd sql create database -x step1 return -1 @@ -40,7 +40,7 @@ if $rows != 0 then endi print =============== step4 -sql create database a012345678901201234567890120123456789012 -x step4 +sql create database a012345678901201234567890120123456789012a012345678901201234567890120123456789012 -x step4 return -1 step4: sql show databases diff --git a/tests/script/windows/field/binary.sim b/tests/script/windows/field/binary.sim index cd75b63814..8b86c4dbea 100644 --- a/tests/script/windows/field/binary.sim +++ b/tests/script/windows/field/binary.sim @@ -55,17 +55,10 @@ if $rows != 75 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol -x step13 - return -1 -step13: - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol -x step14 - return -1 -step14: - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol -x step15 - return -1 -step15: +print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' +sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol +sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol +sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol #can't filter binary fields diff --git a/tests/script/windows/import/basic.sim b/tests/script/windows/import/basic.sim index 0621721a6b..c20378ee88 100644 --- a/tests/script/windows/import/basic.sim +++ b/tests/script/windows/import/basic.sim @@ -6,111 +6,112 @@ sql use ibadb sql create table tb(ts timestamp, i int) print ================= step1 -sql import into tb values(10000, 10000) + +sql import into tb values(1564641710000, 10000) sql select * from tb; if $rows != 1 then return -1 endi print ================= step2 -sql insert into tb values(8000, 8000) -sql select * from tb; -if $rows != 1 then - return -1 -endi - -print ================= step3 -sql insert into tb values(20000, 20000) +sql insert into tb values(1564641708000, 8000) sql select * from tb; if $rows != 2 then return -1 endi +print ================= step3 +sql insert into tb values(1564641720000, 20000) +sql select * from tb; +if $rows != 3 then + return -1 +endi + print ================= step4 -sql import into tb values(8000, 8000) -sql import into tb values(15000, 15000) -sql import into tb values(30000, 30000) +sql import into tb values(1564641708000, 8000) +sql import into tb values(1564641715000, 15000) +sql import into tb values(1564641730000, 30000) sql select * from tb; if $rows != 5 then return -1 endi print ================= step5 -sql insert into tb values(8000, 8000) -sql insert into tb values(14000, 14000) -sql insert into tb values(25000, 25000) -sql insert into tb values(40000, 40000) +sql insert into tb values(1564641708000, 8000) +sql insert into tb values(1564641714000, 14000) +sql insert into tb values(1564641725000, 25000) +sql insert into tb values(1564641740000, 40000) sql select * from tb; -if $rows != 6 then +if $rows != 8 then return -1 endi print ================= step6 -sql import into tb values(7000, 7000) -sql import into tb values(12000, 12000) -sql import into tb values(23000, 23000) -sql import into tb values(34000, 34000) -sql import into tb values(50000, 50000) +sql import into tb values(1564641707000, 7000) +sql import into tb values(1564641712000, 12000) +sql import into tb values(1564641723000, 23000) +sql import into tb values(1564641734000, 34000) +sql import into tb values(1564641750000, 50000) sql select * from tb; -if $rows != 11 then +if $rows != 13 then return -1 endi print ================= step7 -sql import into tb values(7001, 7001) -sql import into tb values(12001, 12001) -sql import into tb values(23001, 23001) -sql import into tb values(34001, 34001) -sql import into tb values(50001, 50001) -sql select * from tb; -if $rows != 16 then - return -1 -endi - -print ================= step8 -sql insert into tb values(8002, 8002) -sql insert into tb values(14002, 14002) -sql insert into tb values(25002, 25002) -sql insert into tb values(200000, 60000) -sql select * from tb; -if $rows != 17 then - return -1 -endi - -print ================= step9 only insert last one -sql import into tb values(5000, 5000)(18000, 18000)(700000, 700000) +sql import into tb values(1564641707001, 7001) +sql import into tb values(1564641712001, 12001) +sql import into tb values(1564641723001, 23001) +sql import into tb values(1564641734001, 34001) +sql import into tb values(1564641750001, 50001) sql select * from tb; if $rows != 18 then return -1 endi -print ================= step10 -sql import into tb values(5000, 5000)(18000, 18000)(700000, 70000) +print ================= step8 +sql insert into tb values(1564641708002, 8002) +sql insert into tb values(1564641714002, 14002) +sql insert into tb values(1564641725002, 25002) +sql insert into tb values(1564641900000, 200000) sql select * from tb; -if $rows != 19 then +if $rows != 22 then + return -1 +endi + +print ================= step9 only insert last one +sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000) +sql select * from tb; +if $rows != 25 then + return -1 +endi + +print ================= step10 +sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000) +sql select * from tb; +if $rows != 25 then return -1 endi print ================= step11 -sql import into tb values(700000, 700000) +sql import into tb values(1564642400000, 700000) sql select * from tb; -if $rows != 19 then +if $rows != 25 then return -1 endi print ================= step12 -sql import into tb values(9527, 9527)(9527, 9528) +sql import into tb values(1564641709527, 9527)(1564641709527, 9528) sql select * from tb; print rows=> $rows -if $rows != 21 then +if $rows != 26 then return -1 endi print ================= step13 -sql import into tb values(9898, 9898)(9897, 9897) +sql import into tb values(1564641709898, 9898)(1564641709897, 9897) sql select * from tb; print rows=> $rows -if $rows != 23 then +if $rows != 28 then return -1 endi diff --git a/tests/script/windows/insert/basic.sim b/tests/script/windows/insert/basic.sim index 42fdf87098..be0980a2d4 100644 --- a/tests/script/windows/insert/basic.sim +++ b/tests/script/windows/insert/basic.sim @@ -22,20 +22,20 @@ while $x < 10 endw print =============== step 2 -sql insert into $tb values (now - 5m , 10) -x error_insert -sql insert into $tb values (now - 6m , 10) -x error_insert -sql insert into $tb values (now - 7m , 10) -x error_insert -sql insert into $tb values (now - 8m , 10) -x error_insert -error_insert: +sql insert into $tb values (now - 5m , 10) +sql insert into $tb values (now - 6m , 10) +sql insert into $tb values (now - 7m , 10) +sql insert into $tb values (now - 8m , 10) sql select * from $tb print $rows points data are retrieved -if $rows != 10 then +if $rows != 14 then return -1 endi sql drop database $db +sleep 1000 sql show databases if $rows != 0 then return -1 diff --git a/tests/script/windows/insert/query_multi_file.sim b/tests/script/windows/insert/query_multi_file.sim index 3170b43582..84c091fb21 100644 --- a/tests/script/windows/insert/query_multi_file.sim +++ b/tests/script/windows/insert/query_multi_file.sim @@ -27,7 +27,7 @@ $N = 20000 $x = 0 while $x < $N - $ms = $x . m + $ms = $x . s #print insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x ) -x error_insert $x = $x + 1 diff --git a/tests/script/windows/table/binary.sim b/tests/script/windows/table/binary.sim index 1f3df987bb..69354ed5c8 100644 --- a/tests/script/windows/table/binary.sim +++ b/tests/script/windows/table/binary.sim @@ -38,7 +38,8 @@ if $data00 != 23456 then endi print =============== step4 -sql insert into $tb values (now+3a, '345678') +sql_error insert into $tb values (now+3a, '345678') +sql insert into $tb values (now+3a, '34567') sql select speed from $tb order by ts desc if $rows != 3 then return -1 diff --git a/tests/script/windows/table/bool.sim b/tests/script/windows/table/bool.sim index afaaf46f51..9e434d801a 100644 --- a/tests/script/windows/table/bool.sim +++ b/tests/script/windows/table/bool.sim @@ -19,7 +19,7 @@ if $rows != 1 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -30,7 +30,7 @@ if $rows != 2 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -41,7 +41,7 @@ if $rows != 3 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -52,7 +52,7 @@ if $rows != 4 then return -1 endi -if $data01 != false then +if $data01 != 0 then return -1 endi @@ -63,7 +63,7 @@ if $rows != 5 then return -1 endi -if $data01 != true then +if $data01 != 1 then return -1 endi @@ -74,7 +74,7 @@ if $rows != 6 then return -1 endi -if $data01 != false then +if $data01 != 0 then return -1 endi diff --git a/tests/script/windows/table/column_value.sim b/tests/script/windows/table/column_value.sim index d3b120d08e..9dbaf7ceab 100644 --- a/tests/script/windows/table/column_value.sim +++ b/tests/script/windows/table/column_value.sim @@ -29,13 +29,12 @@ if $rows != 0 then endi print =============== step2 -sql create table $tb (ts timestamp, speed bigint, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -x step2 - return -1 -step2: +sql create table $tb (ts timestamp, speed bigint, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) sql show tables -if $rows != 0 then +if $rows != 1 then return -1 endi +sql drop table $tb print =============== step3 sql create table $tb (ts timestamp, speed float, v1 binary(100), v2 binary(100), v3 binary(100), v4 binary(100), v5 binary(100)) @@ -56,11 +55,9 @@ if $rows != 0 then endi print =============== step4 -sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -x step4 - return -1 -step4: +sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) sql show tables -if $rows != 0 then +if $rows != 1 then return -1 endi diff --git a/tests/script/windows/table/float.sim b/tests/script/windows/table/float.sim index 4188f62166..57b626f865 100644 --- a/tests/script/windows/table/float.sim +++ b/tests/script/windows/table/float.sim @@ -31,7 +31,7 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != 2.8500 then +if $data01 != 2.85000 then return -1 endi @@ -41,7 +41,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != 3.4000 then +if $data01 != 3.40000 then return -1 endi @@ -54,7 +54,7 @@ sql select * from $tb order by ts desc if $rows != 3 then return -1 endi -if $data01 != 0.0000 then +if $data01 != 0.00000 then return -1 endi @@ -67,7 +67,7 @@ sql select * from $tb order by ts desc if $rows != 4 then return -1 endi -if $data01 != 2.0000 then +if $data01 != 2.00000 then return -1 endi @@ -80,7 +80,7 @@ sql select * from $tb order by ts desc if $rows != 5 then return -1 endi -if $data01 != 2.0000 then +if $data01 != 2.00000 then return -1 endi diff --git a/tests/script/windows/table/table.sim b/tests/script/windows/table/table.sim index fe93fec6cd..55be8af851 100644 --- a/tests/script/windows/table/table.sim +++ b/tests/script/windows/table/table.sim @@ -58,7 +58,7 @@ sql create table $tb (ts timestamp, val float, val2 float) sql insert into $tb values(now, 5, 5) sql select * from $tb print ==> $data01 $data02 -if $data01 != 5.0000 then +if $data01 != 5.00000 then return -1 endi @@ -162,7 +162,7 @@ endi sql insert into $tb values(now, 5, 5) sql select * from $tb print ==> $data01 $data02 -if $data01 != 5.0000 then +if $data01 != 5.00000 then return -1 endi diff --git a/tests/script/windows/table/table_len.sim b/tests/script/windows/table/table_len.sim index b792044b40..cdd1f31731 100644 --- a/tests/script/windows/table/table_len.sim +++ b/tests/script/windows/table/table_len.sim @@ -51,7 +51,7 @@ if $rows != 0 then endi print =============== step4 -sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 +sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 return -1 step4: sql show tables diff --git a/tests/script/windows/tag/add.sim b/tests/script/windows/tag/add.sim index adcff4f62d..2c72d01955 100644 --- a/tests/script/windows/tag/add.sim +++ b/tests/script/windows/tag/add.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -40,7 +40,7 @@ endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 int sql reset query cache -sql alter table $tb set tgcol4 =4 +sql alter table $tb set tag tgcol4 =4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -51,7 +51,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 4 then @@ -86,7 +86,7 @@ endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 tinyint sql reset query cache -sql alter table $tb set tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -125,28 +125,29 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi sql describe $tb +print sql describe $tb if $data21 != BIGINT then return -1 endi if $data31 != FLOAT then return -1 endi -if $data23 != 1 then +if $data23 != TAG then return -1 endi -if $data33 != 2.000000 then +if $data33 != TAG then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 float sql reset query cache -sql alter table $tb set tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -160,7 +161,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi @@ -192,7 +193,7 @@ endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 smallint sql reset query cache -sql alter table $tb set tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 @@ -228,7 +229,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -245,9 +246,9 @@ sql alter table $mt add tag tgcol5 binary(10) sql alter table $mt add tag tgcol6 binary(10) sql reset query cache -sql alter table $tb set tgcol4=false -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=6 +sql alter table $tb set tag tgcol4=false +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol5 = '5' @@ -258,7 +259,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 5 then @@ -276,7 +277,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 5 then @@ -325,9 +326,9 @@ sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol6 tinyint sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=6 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol6 = 6 @@ -372,7 +373,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi if $data04 != 3 then @@ -385,9 +386,9 @@ sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(17) sql alter table $mt add tag tgcol6 bool sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=true +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=1 sql reset query cache sql select * from $mt where tgcol5 = '5' @@ -405,7 +406,7 @@ endi if $data03 != 5 then return -1 endi -if $data04 != true then +if $data04 != 1 then return -1 endi @@ -447,12 +448,12 @@ sql alter table $mt add tag tgcol5 bool sql alter table $mt add tag tgcol6 float sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=true -sql alter table $tb set tgcol6=6 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=1 +sql alter table $tb set tag tgcol6=6 sql reset query cache -sql select * from $mt where tgcol5 = true +sql select * from $mt where tgcol5 = 1 print $data01 $data02 $data03 if $rows != 1 then return -1 @@ -463,10 +464,10 @@ endi if $data02 != 4.000000000 then return -1 endi -if $data03 != true then +if $data03 != 1 then return -1 endi -if $data04 != 6.0000 then +if $data04 != 6.00000 then return -1 endi @@ -516,8 +517,8 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bool sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=false +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=false sql reset query cache sql select * from $mt where tgcol4 = '4' @@ -534,10 +535,10 @@ endi if $data03 != 4 then return -1 endi -if $data04 != false then +if $data04 != 0 then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi @@ -562,7 +563,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -571,7 +572,7 @@ endi if $data04 != 3 then return -1 endi -if $data05 != 4.0000 then +if $data05 != 4.00000 then return -1 endi if $data06 != 5 then @@ -594,11 +595,11 @@ sql alter table $mt add tag tgcol7 bigint sql alter table $mt add tag tgcol8 smallint sql reset query cache -sql alter table $tb set tgcol4=4 -sql alter table $tb set tgcol5=5 -sql alter table $tb set tgcol6=6 -sql alter table $tb set tgcol7=7 -sql alter table $tb set tgcol8=8 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 +sql alter table $tb set tag tgcol7=7 +sql alter table $tb set tag tgcol8=8 sql reset query cache sql select * from $mt where tgcol5 =5 @@ -609,7 +610,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 4 then @@ -652,13 +653,13 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then return -1 endi -if $data04 != 3.0000 then +if $data04 != 3.00000 then return -1 endi if $data05 != 4.000000000 then @@ -682,12 +683,12 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bigint sql reset query cache -sql alter table $tb set tgcol1=false -sql alter table $tb set tgcol2=5 -sql alter table $tb set tgcol3=4 -sql alter table $tb set tgcol4=3 -sql alter table $tb set tgcol5=2 -sql alter table $tb set tgcol6=1 +sql alter table $tb set tag tgcol1=false +sql alter table $tb set tag tgcol2=5 +sql alter table $tb set tag tgcol3=4 +sql alter table $tb set tag tgcol4=3 +sql alter table $tb set tag tgcol5=2 +sql alter table $tb set tag tgcol6=1 sql reset query cache sql select * from $mt where tgcol4 = '3' @@ -698,7 +699,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 1 then @@ -779,12 +780,12 @@ sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol6 bigint sql reset query cache -sql alter table $tb set tgcol1=7 -sql alter table $tb set tgcol2=8 -sql alter table $tb set tgcol3=9 -sql alter table $tb set tgcol4=10 -sql alter table $tb set tgcol5=11 -sql alter table $tb set tgcol6=12 +sql alter table $tb set tag tgcol1=7 +sql alter table $tb set tag tgcol2=8 +sql alter table $tb set tag tgcol3=9 +sql alter table $tb set tag tgcol4=10 +sql alter table $tb set tag tgcol5=11 +sql alter table $tb set tag tgcol6=12 sql reset query cache sql select * from $mt where tgcol2 = '8' @@ -826,6 +827,8 @@ sql alter table $mt add tag tgcol3 binary(10) sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol6 bigint + +return sql alter table $mt add tag tgcol7 bigint -x step141 return -1 step141: diff --git a/tests/script/windows/tag/change.sim b/tests/script/windows/tag/change.sim index 95a767da49..2901842190 100644 --- a/tests/script/windows/tag/change.sim +++ b/tests/script/windows/tag/change.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -43,9 +43,9 @@ step21: sql alter table $mt change tag tgcol1 tgcol2 -x step22 return -1 step22: -sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20 - return -1 -step20: +#sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20 +# return -1 +#step20: sql alter table $mt change tag tgcol1 tgcol3 sql alter table $mt change tag tgcol2 tgcol4 @@ -94,7 +94,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi @@ -191,7 +191,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -206,7 +206,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -278,22 +278,22 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi sql select * from $mt where tgcol4 = 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi @@ -386,7 +386,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -413,7 +413,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -440,7 +440,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -467,7 +467,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -494,7 +494,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -503,4 +503,4 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi diff --git a/tests/script/windows/tag/create.sim b/tests/script/windows/tag/create.sim index e7f7163160..5beba21727 100644 --- a/tests/script/windows/tag/create.sim +++ b/tests/script/windows/tag/create.sim @@ -126,7 +126,8 @@ if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then + print expect 0, actual: $rows return -1 endi @@ -176,7 +177,8 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bool) sql create table $tb using $mt tags( 1, 2 ) sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then + print expect 1, actual: $rows return -1 endi if $data01 != 1 then @@ -569,7 +571,7 @@ $i = 30 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250), tgcol3 binary(30)) -x step30 - return -1 +# return -1 step30: print =============== step31 @@ -577,7 +579,8 @@ $i = 31 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(5)) -sql create table $tb using $mt tags('1234567') +sql_error create table $tb using $mt tags('1234567') +sql create table $tb using $mt tags('12345') sql insert into $tb values(now, 1) sql select * from $mt print sql select * from $mt diff --git a/tests/script/windows/tag/delete.sim b/tests/script/windows/tag/delete.sim index 75702fe9ee..e2395c8f97 100644 --- a/tests/script/windows/tag/delete.sim +++ b/tests/script/windows/tag/delete.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -79,7 +79,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi @@ -90,7 +90,7 @@ endi if $data31 != FLOAT then return -1 endi -if $data23 != 1 then +if $data23 != TAG then return -1 endi @@ -139,7 +139,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -195,13 +195,13 @@ endi if $data42 != 10 then return -1 endi -if $data23 != 1 then +if $data23 != TAG then return -1 endi -if $data33 != 2 then +if $data33 != TAG then return -1 endi -if $data43 != 3 then +if $data43 != TAG then return -1 endi @@ -225,7 +225,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi if $data04 != 3 then @@ -307,7 +307,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -316,7 +316,7 @@ endi if $data04 != 3 then return -1 endi -if $data05 != 4.0000 then +if $data05 != 4.00000 then return -1 endi if $data06 != 5 then @@ -341,13 +341,13 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then return -1 endi -if $data04 != 3.0000 then +if $data04 != 3.00000 then return -1 endi if $data05 != 4.000000000 then @@ -417,10 +417,10 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -444,7 +444,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -468,7 +468,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -492,7 +492,7 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi @@ -513,13 +513,13 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -546,10 +546,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -576,10 +576,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -606,10 +606,10 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi @@ -636,13 +636,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != NULL then +if $data03 != null then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi @@ -669,19 +669,19 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi -if $data06 != NULL then +if $data06 != null then return -1 endi @@ -708,22 +708,22 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 4.000000000 then return -1 endi -if $data04 != NULL then +if $data04 != null then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi -if $data06 != NULL then +if $data06 != null then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -763,13 +763,13 @@ endi if $data04 != 5.000000000 then return -1 endi -if $data05 != NULL then +if $data05 != null then return -1 endi -if $data06 != NULL then +if $data06 != null then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi diff --git a/tests/script/windows/tag/filter.sim b/tests/script/windows/tag/filter.sim index 72a8e39dc8..b70e56fdb6 100644 --- a/tests/script/windows/tag/filter.sim +++ b/tests/script/windows/tag/filter.sim @@ -85,9 +85,7 @@ sql select count(tgcol), avg(tgcol), sum(tgcol), min(tgcol), max(tgcol), first(t step7: print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tbcol -x step8 - return -1 -step8: +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tbcol print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by noexist -x step9 @@ -102,9 +100,7 @@ if $data00 != 100 then endi print =============== step11 -sql select count(tbcol) as c from $mt group by tbcol -x step11 - return -1 -step11: +sql select count(tbcol) as c from $mt group by tbcol print =============== step12 sql select count(tbcol) as c from $mt group by noexist -x step12 @@ -121,7 +117,8 @@ endi print =============== step14 sql select count(tbcol) as c from $mt where ts > 1000 group by tgcol print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +if $data00 != 100 then + print expect 100, actual $data00 return -1 endi diff --git a/tests/script/windows/tag/set.sim b/tests/script/windows/tag/set.sim index b264164604..580f91cb49 100644 --- a/tests/script/windows/tag/set.sim +++ b/tests/script/windows/tag/set.sim @@ -30,7 +30,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != true then +if $data02 != 1 then return -1 endi if $data03 != 2 then @@ -40,8 +40,8 @@ endi sql alter table $tb set tag tagcx 1 -x step21 return -1 step21: -sql alter table $tb set tgcol1=false -sql alter table $tb set tgcol2=4 +sql alter table $tb set tag tgcol1=false +sql alter table $tb set tag tgcol2=4 sql reset query cache @@ -53,7 +53,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 4 then @@ -68,7 +68,7 @@ endi if $data01 != 1 then return -1 endi -if $data02 != false then +if $data02 != 0 then return -1 endi if $data03 != 4 then @@ -83,10 +83,10 @@ endi if $data31 != INT then return -1 endi -if $data23 != false then +if $data23 != TAG then return -1 endi -if $data33 != 4 then +if $data33 != TAG then return -1 endi @@ -111,8 +111,8 @@ if $data03 != 2 then return -1 endi -sql alter table $tb set tgcol1=3 -sql alter table $tb set tgcol2=4 +sql alter table $tb set tag tgcol1=3 +sql alter table $tb set tag tgcol2=4 sql reset query cache @@ -169,12 +169,12 @@ endi if $data02 != 1 then return -1 endi -if $data03 != 2.0000 then +if $data03 != 2.00000 then return -1 endi -sql alter table $tb set tgcol1=3 -sql alter table $tb set tgcol2=4 +sql alter table $tb set tag tgcol1=3 +sql alter table $tb set tag tgcol2=4 sql reset query cache @@ -189,7 +189,7 @@ endi if $data02 != 3 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi @@ -204,7 +204,7 @@ endi if $data02 != 3 then return -1 endi -if $data03 != 4.0000 then +if $data03 != 4.00000 then return -1 endi @@ -230,8 +230,8 @@ if $data03 != 2 then return -1 endi -sql alter table $tb set tgcol1=3 -sql alter table $tb set tgcol2='4' +sql alter table $tb set tag tgcol1=3 +sql alter table $tb set tag tgcol2='4' sql reset query cache @@ -299,11 +299,11 @@ if $data07 != 6 then endi sql alter table $mt drop tag tgcol3 -sql alter table $tb set tgcol1='7' -sql alter table $tb set tgcol2=8 -sql alter table $tb set tgcol4='9' -sql alter table $tb set tgcol5=10 -sql alter table $tb set tgcol6='11' +sql alter table $tb set tag tgcol1='7' +sql alter table $tb set tag tgcol2=8 +sql alter table $tb set tag tgcol4='9' +sql alter table $tb set tag tgcol5=10 +sql alter table $tb set tag tgcol6='11' sql reset query cache @@ -330,7 +330,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -357,7 +357,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -384,7 +384,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -411,7 +411,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi @@ -438,7 +438,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != NULL then +if $data07 != null then return -1 endi diff --git a/tests/script/windows/testSuite.sim b/tests/script/windows/testSuite.sim index 9aa7147ef6..e372217b62 100644 --- a/tests/script/windows/testSuite.sim +++ b/tests/script/windows/testSuite.sim @@ -1,97 +1,93 @@ -run windows/account/user_create.sim -run windows/account/user_len.sim - -run windows/db/len.sim - -run windows/table/table.sim -run windows/table/table_len.sim -run windows/table/column_num.sim -run windows/table/column_name.sim -run windows/table/column_value.sim -run windows/table/binary.sim -run windows/table/bool.sim -run windows/table/double.sim -run windows/table/float.sim -run windows/table/db.table.sim - -run windows/import/basic.sim - run windows/alter/table.sim run windows/alter/metrics.sim -run windows/compute/count.sim run windows/compute/avg.sim -run windows/compute/sum.sim -run windows/compute/min.sim -run windows/compute/max.sim -run windows/compute/first.sim -run windows/compute/last.sim -run windows/compute/stddev.sim -#run windows/compute/leastsquare.sim -run windows/compute/top.sim run windows/compute/bottom.sim -run windows/compute/percentile.sim +run windows/compute/count.sim run windows/compute/diff.sim +run windows/compute/first.sim run windows/compute/interval.sim - -run windows/field/single.sim -run windows/field/bool.sim -run windows/field/smallint.sim -run windows/field/tinyint.sim -run windows/field/int.sim -run windows/field/bigint.sim -run windows/field/float.sim -run windows/field/double.sim -run windows/field/binary.sim +run windows/compute/last.sim +run windows/compute/leastsquare.sim +run windows/compute/max.sim +run windows/compute/min.sim +run windows/compute/percentile.sim +run windows/compute/stddev.sim +run windows/compute/sum.sim +run windows/compute/top.sim + +run windows/db/basic.sim +run windows/db/len.sim + run windows/field/2.sim run windows/field/3.sim run windows/field/4.sim run windows/field/5.sim run windows/field/6.sim +run windows/field/bigint.sim +run windows/field/binary.sim +run windows/field/bool.sim +run windows/field/double.sim +run windows/field/float.sim +run windows/field/int.sim +run windows/field/single.sim +run windows/field/smallint.sim +run windows/field/tinyint.sim + +run windows/import/basic.sim + +run windows/insert/basic.sim +run windows/insert/query_block1_file.sim +run windows/insert/query_block1_memory.sim +run windows/insert/query_block2_file.sim +run windows/insert/query_block2_memory.sim +run windows/insert/query_file_memory.sim +run windows/insert/query_multi_file.sim + +run windows/table/binary.sim +run windows/table/bool.sim +run windows/table/column_num.sim +run windows/table/column_name.sim +run windows/table/column_value.sim +run windows/table/db.table.sim +run windows/table/double.sim +run windows/table/float.sim +run windows/table/table_len.sim +run windows/table/table.sim -run windows/tag/filter.sim -run windows/tag/column.sim -run windows/tag/bool.sim -run windows/tag/smallint.sim -run windows/tag/tinyint.sim -run windows/tag/int.sim -run windows/tag/bigint.sim -run windows/tag/float.sim -run windows/tag/double.sim -run windows/tag/binary.sim -run windows/tag/bool_int.sim -run windows/tag/bool_binary.sim -run windows/tag/int_float.sim -run windows/tag/int_binary.sim -run windows/tag/binary_binary.sim run windows/tag/3.sim run windows/tag/4.sim run windows/tag/5.sim run windows/tag/6.sim +run windows/tag/add.sim +run windows/tag/bigint.sim +run windows/tag/binary_binary.sim +run windows/tag/binary.sim +run windows/tag/bool_binary.sim +run windows/tag/bool_int.sim +run windows/tag/bool.sim +run windows/tag/change.sim +run windows/tag/column.sim run windows/tag/create.sim -#run windows/tag/delete.sim +run windows/tag/delete.sim +run windows/tag/double.sim +run windows/tag/filter.sim +run windows/tag/float.sim +run windows/tag/int_binary.sim +run windows/tag/int_float.sim +run windows/tag/int.sim +run windows/tag/set.sim +run windows/tag/smallint.sim +run windows/tag/tinyint.sim -#run windows/tag/set.sim -#run windows/tag/add.sim - -run windows/vector/single.sim -run windows/vector/multi.sim -run windows/vector/table_query.sim -run windows/vector/table_time.sim -run windows/vector/table_field.sim -run windows/vector/table_mix.sim +run windows/vector/metrics_field.sim +run windows/vector/metrics_mix.sim run windows/vector/metrics_query.sim run windows/vector/metrics_tag.sim run windows/vector/metrics_time.sim -run windows/vector/metrics_field.sim -run windows/vector/metrics_mix.sim - -run windows/insert/basic.sim -run windows/insert/query_block1_memory.sim -run windows/insert/query_block2_memory.sim -run windows/insert/query_block1_file.sim -#run windows/insert/query_block2_file.sim -#run windows/insert/query_file_memory.sim -#run windows/insert/query_multi_file.sim - -run windows/tag/change.sim +run windows/vector/multi.sim +run windows/vector/single.sim +run windows/vector/table_field.sim +run windows/vector/table_mix.sim +run windows/vector/table_query.sim +run windows/vector/table_time.sim diff --git a/tests/script/windows/vector/multi.sim b/tests/script/windows/vector/multi.sim index 969ba5aa19..adcc94db3b 100644 --- a/tests/script/windows/vector/multi.sim +++ b/tests/script/windows/vector/multi.sim @@ -200,7 +200,6 @@ sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step return -1 step74: - print =============== clear sql drop database $db sql show databases diff --git a/tests/tsim/CMakeLists.txt b/tests/tsim/CMakeLists.txt index 64adce5945..50b42941af 100644 --- a/tests/tsim/CMakeLists.txt +++ b/tests/tsim/CMakeLists.txt @@ -4,10 +4,6 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) INCLUDE_DIRECTORIES(inc) -IF (TD_WINDOWS) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) -ENDIF () - AUX_SOURCE_DIRECTORY(src SRC) ADD_EXECUTABLE(tsim ${SRC}) TARGET_LINK_LIBRARIES(tsim taos_static trpc tutil pthread cJson) diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 1078b32981..8bc9a76545 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -313,7 +313,9 @@ bool simExecuteSystemCmd(SScript *script, char *option) { simError("script:%s, failed to execute %s , code %d, errno:%d %s, repeatTimes:%d", script->fileName, buf, code, errno, strerror(errno), repeatTimes); taosMsleep(1000); +#ifdef LINUX signal(SIGCHLD, SIG_DFL); +#endif if (repeatTimes++ >= 10) { exit(0); } @@ -418,14 +420,14 @@ void simVisuallizeOption(SScript *script, char *src, char *dst) { var = strchr(src, '$'); if (var == NULL) break; if (var && ((var - src - 1) > 0) && *(var - 1) == '\\') { - srcLen = var - src - 1; + srcLen = (int)(var - src - 1); memcpy(dst + dstLen, src, srcLen); dstLen += srcLen; src = var; break; } - srcLen = var - src; + srcLen = (int)(var - src); memcpy(dst + dstLen, src, srcLen); dstLen += srcLen; @@ -433,7 +435,7 @@ void simVisuallizeOption(SScript *script, char *src, char *dst) { value = simGetVariable(script, token, tokenLen); strcpy(dst + dstLen, value); - dstLen += strlen(value); + dstLen += (int)strlen(value); } strcpy(dst + dstLen, src); @@ -455,9 +457,9 @@ void simCloseNativeConnect(SScript *script) { void simCloseTaosdConnect(SScript *script) { if (simAsyncQuery) { - return simCloseRestFulConnect(script); + simCloseRestFulConnect(script); } else { - return simCloseNativeConnect(script); + simCloseNativeConnect(script); } } // {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} @@ -575,7 +577,7 @@ int simExecuteRestFulCommand(SScript *script, char *command) { while (!feof(fp)) { int availSize = mallocSize - alreadyReadSize; - int len = fread(content + alreadyReadSize, 1, availSize, fp); + int len = (int)fread(content + alreadyReadSize, 1, availSize, fp); if (len >= availSize) { alreadyReadSize += len; mallocSize *= 2; diff --git a/tests/tsim/src/simParse.c b/tests/tsim/src/simParse.c index 2528fde9f5..f201f149a1 100644 --- a/tests/tsim/src/simParse.c +++ b/tests/tsim/src/simParse.c @@ -105,7 +105,7 @@ void simAddCmdIntoHash(SCommand *pCmd) { int hash; SCommand *node; - hash = simHashCmd(pCmd->name, strlen(pCmd->name)); + hash = simHashCmd(pCmd->name, (int)strlen(pCmd->name)); node = cmdHashList[hash]; pCmd->next = node; cmdHashList[hash] = pCmd; @@ -199,7 +199,7 @@ SScript *simParseScript(char *fileName) { if (fgets(buffer, sizeof(buffer), fd) == NULL) continue; lineNum++; - int cmdlen = strlen(buffer); + int cmdlen = (int)strlen(buffer); if (buffer[cmdlen - 1] == '\r' || buffer[cmdlen - 1] == '\n') buffer[cmdlen - 1] = 0; rest = buffer; @@ -294,10 +294,10 @@ int simCheckExpression(char *exp) { rest = paGetToken(rest, &op, &opLen); - if (opLen == 0) return rest - exp; + if (opLen == 0) return (int)(rest - exp); /* if it is key word "then" */ - if (strncmp(op, "then", 4) == 0) return op - exp; + if (strncmp(op, "then", 4) == 0) return (int)(op - exp); rest = paGetToken(rest, &op2, &op2Len); if (op2Len == 0) { @@ -312,7 +312,7 @@ int simCheckExpression(char *exp) { if (op[0] == '+' || op[0] == '-' || op[0] == '*' || op[0] == '/' || op[0] == '.') { - return rest - exp; + return (int)(rest - exp); } return -1; @@ -655,7 +655,7 @@ bool simParsePrintCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_PRINT; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -690,7 +690,7 @@ bool simParseSqlCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_SQL; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -706,7 +706,7 @@ bool simParseSqlErrorCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_SQL_ERROR; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -728,7 +728,7 @@ bool simParseSystemCmd(char *rest, SCommand *pCmd, int lineNum) { cmdLine[numOfLines].cmdno = SIM_CMD_SYSTEM; cmdLine[numOfLines].lineNum = lineNum; cmdLine[numOfLines].optionOffset = optionOffset; - expLen = strlen(rest); + expLen = (int)strlen(rest); memcpy(optionBuffer + optionOffset, rest, expLen); optionOffset += expLen + 1; *(optionBuffer + optionOffset - 1) = 0; @@ -840,14 +840,14 @@ void simInitsimCmdList() { cmdno = SIM_CMD_EXP; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "exp"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = NULL; simCmdList[cmdno].executeCmd = simExecuteExpCmd; cmdno = SIM_CMD_IF; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "if"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseIfCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -855,7 +855,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ELIF; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "elif"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseElifCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -863,7 +863,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ELSE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "else"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseElseCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -871,7 +871,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ENDI; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "endi"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseEndiCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -879,7 +879,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_WHILE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "while"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseWhileCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -887,7 +887,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ENDW; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "endw"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseEndwCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -895,7 +895,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SWITCH; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "switch"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSwitchCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -903,7 +903,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_CASE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "case"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseCaseCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -911,7 +911,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_DEFAULT; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "default"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseDefaultCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -919,7 +919,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_BREAK; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "break"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseBreakCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -927,7 +927,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_CONTINUE; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "continue"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseContinueCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -935,7 +935,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_ENDS; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "ends"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseEndsCmd; simCmdList[cmdno].executeCmd = NULL; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -943,7 +943,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SLEEP; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sleep"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSleepCmd; simCmdList[cmdno].executeCmd = simExecuteSleepCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -951,7 +951,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_GOTO; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "goto"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseGotoCmd; simCmdList[cmdno].executeCmd = simExecuteGotoCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -959,7 +959,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_RUN; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "run"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseRunCmd; simCmdList[cmdno].executeCmd = simExecuteRunCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -967,7 +967,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_RUN_BACK; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "run_back"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseRunBackCmd; simCmdList[cmdno].executeCmd = simExecuteRunBackCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -975,7 +975,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SYSTEM; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "system"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSystemCmd; simCmdList[cmdno].executeCmd = simExecuteSystemCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -983,7 +983,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SYSTEM_CONTENT; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "system_content"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSystemContentCmd; simCmdList[cmdno].executeCmd = simExecuteSystemContentCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -991,7 +991,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_PRINT; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "print"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParsePrintCmd; simCmdList[cmdno].executeCmd = simExecutePrintCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -999,7 +999,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SQL; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sql"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSqlCmd; simCmdList[cmdno].executeCmd = simExecuteSqlCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -1007,7 +1007,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SQL_ERROR; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sql_error"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSqlErrorCmd; simCmdList[cmdno].executeCmd = simExecuteSqlErrorCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -1015,7 +1015,7 @@ void simInitsimCmdList() { cmdno = SIM_CMD_SQL_SLOW; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "sql_slow"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseSqlSlowCmd; simCmdList[cmdno].executeCmd = simExecuteSqlSlowCmd; simAddCmdIntoHash(&(simCmdList[cmdno])); @@ -1024,14 +1024,14 @@ void simInitsimCmdList() { cmdno = SIM_CMD_TEST; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "test"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = NULL; simCmdList[cmdno].executeCmd = simExecuteTestCmd; cmdno = SIM_CMD_RETURN; simCmdList[cmdno].cmdno = cmdno; strcpy(simCmdList[cmdno].name, "return"); - simCmdList[cmdno].nlen = strlen(simCmdList[cmdno].name); + simCmdList[cmdno].nlen = (int)strlen(simCmdList[cmdno].name); simCmdList[cmdno].parseCmd = simParseReturnCmd; simCmdList[cmdno].executeCmd = simExecuteReturnCmd; simAddCmdIntoHash(&(simCmdList[cmdno]));