early-access version 2853
This commit is contained in:
14
externals/vcpkg/ports/gettimeofday/CMakeLists.txt
vendored
Executable file
14
externals/vcpkg/ports/gettimeofday/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(gettimeofday C)
|
||||
|
||||
add_library(gettimeofday gettimeofday.c gettimeofday.def)
|
||||
|
||||
install(TARGETS gettimeofday
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib/manual-link
|
||||
LIBRARY DESTINATION lib/manual-link
|
||||
)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
install(FILES gettimeofday.h DESTINATION include)
|
||||
endif()
|
||||
33
externals/vcpkg/ports/gettimeofday/LICENSE
vendored
Executable file
33
externals/vcpkg/ports/gettimeofday/LICENSE
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copied from PostgreSQL source:
|
||||
* http://doxygen.postgresql.org/gettimeofday_8c_source.html
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* gettimeofday.c
|
||||
* Win32 gettimeofday() replacement
|
||||
*
|
||||
* src/port/gettimeofday.c
|
||||
*
|
||||
* Copyright (c) 2003 SRA, Inc.
|
||||
* Copyright (c) 2003 SKC, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and
|
||||
* its documentation for any purpose, without fee, and without a
|
||||
* written agreement is hereby granted, provided that the above
|
||||
* copyright notice and this paragraph and the following two
|
||||
* paragraphs appear in all copies.
|
||||
*
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
|
||||
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
|
||||
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
|
||||
* DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS
|
||||
* IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
|
||||
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*/
|
||||
67
externals/vcpkg/ports/gettimeofday/gettimeofday.c
vendored
Executable file
67
externals/vcpkg/ports/gettimeofday/gettimeofday.c
vendored
Executable file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copied from PostgreSQL source:
|
||||
* http://doxygen.postgresql.org/gettimeofday_8c_source.html
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* gettimeofday.c
|
||||
* Win32 gettimeofday() replacement
|
||||
*
|
||||
* src/port/gettimeofday.c
|
||||
*
|
||||
* Copyright (c) 2003 SRA, Inc.
|
||||
* Copyright (c) 2003 SKC, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and
|
||||
* its documentation for any purpose, without fee, and without a
|
||||
* written agreement is hereby granted, provided that the above
|
||||
* copyright notice and this paragraph and the following two
|
||||
* paragraphs appear in all copies.
|
||||
*
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
|
||||
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
|
||||
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
|
||||
* DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS
|
||||
* IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
|
||||
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
|
||||
/* FILETIME of Jan 1 1970 00:00:00. */
|
||||
static const unsigned __int64 epoch = 116444736000000000Ui64;
|
||||
|
||||
/*
|
||||
* timezone information is stored outside the kernel so tzp isn't used anymore.
|
||||
*
|
||||
* Note: this function is not for Win32 high precision timing purpose. See
|
||||
* elapsed_time().
|
||||
*/
|
||||
int
|
||||
gettimeofday(struct timeval * tp, struct timezone * tzp)
|
||||
{
|
||||
FILETIME file_time;
|
||||
SYSTEMTIME system_time;
|
||||
ULARGE_INTEGER ularge;
|
||||
|
||||
GetSystemTime(&system_time);
|
||||
SystemTimeToFileTime(&system_time, &file_time);
|
||||
ularge.LowPart = file_time.dwLowDateTime;
|
||||
ularge.HighPart = file_time.dwHighDateTime;
|
||||
|
||||
tp->tv_sec = (long) ((ularge.QuadPart - epoch) / 10000000L);
|
||||
tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
2
externals/vcpkg/ports/gettimeofday/gettimeofday.def
vendored
Executable file
2
externals/vcpkg/ports/gettimeofday/gettimeofday.def
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
EXPORTS
|
||||
gettimeofday
|
||||
13
externals/vcpkg/ports/gettimeofday/gettimeofday.h
vendored
Executable file
13
externals/vcpkg/ports/gettimeofday/gettimeofday.h
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#ifndef _MY_GETTIMEOFDAY_H_
|
||||
#define _MY_GETTIMEOFDAY_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <time.h>
|
||||
|
||||
int gettimeofday(struct timeval * tp, struct timezone * tzp);
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#endif /* _MY_GETTIMEOFDAY_H_ */
|
||||
9
externals/vcpkg/ports/gettimeofday/portfile.cmake
vendored
Executable file
9
externals/vcpkg/ports/gettimeofday/portfile.cmake
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
6
externals/vcpkg/ports/gettimeofday/vcpkg.json
vendored
Executable file
6
externals/vcpkg/ports/gettimeofday/vcpkg.json
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "gettimeofday",
|
||||
"version-string": "2017-10-14",
|
||||
"port-version": 4,
|
||||
"description": "An implementation of gettimeofday for WIN32"
|
||||
}
|
||||
Reference in New Issue
Block a user