Compare commits

...

4 Commits

Author SHA1 Message Date
f731e9e171 Slap u64 on everything time-y
* get_us_time() will overflow and reset to zero every now and then.
  Had it happen several times in one day,
  https://github.com/minetest/minetest/issues/10105
* backported b5eda416ce
2023-09-17 15:15:22 -04:00
70fd300c5a Fix linking with Postgres libs on older cmake versions
* integrates https://github.com/minetest/minetest/pull/11215
  so it backported a24899bf2d
* closes https://github.com/minetest/minetest/issues/12149
* closes https://github.com/minetest/minetest/issues/11219
* backported 998e4820c9
2023-09-12 21:43:25 -04:00
9d87cd206c Fix no locales being generated when APPLY_LOCALE_BLACKLIST=0
* backported 6caed7073c
  from upstream
2023-09-12 21:26:12 -04:00
2292239f86 fix find_path for newer jsoncpp installations 2023-09-12 20:20:49 -04:00
3 changed files with 11 additions and 6 deletions

View File

@ -8,14 +8,15 @@ option(ENABLE_SYSTEM_JSONCPP "Enable using a system-wide JSONCPP. May cause seg
if(ENABLE_SYSTEM_JSONCPP)
find_library(JSON_LIBRARY NAMES jsoncpp)
find_path(JSON_INCLUDE_DIR json/features.h PATH_SUFFIXES jsoncpp)
find_path(JSON_INCLUDE_DIR json/allocator.h PATH_SUFFIXES jsoncpp)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JSONCPP DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)
find_package_handle_standard_args(Json DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)
if(JSONCPP_FOUND)
if(JSON_FOUND)
message(STATUS "Using system JSONCPP library.")
endif()
endif()
if(NOT JSONCPP_FOUND)

View File

@ -201,6 +201,8 @@ if(ENABLE_POSTGRESQL)
# but we don't need them, so continue anyway if only those are missing.
if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY)
set(PostgreSQL_FOUND TRUE)
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR})
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
endif()
else()
find_package(PostgreSQL)
@ -721,6 +723,8 @@ if (GETTEXT_FOUND AND APPLY_LOCALE_BLACKLIST)
endif()
endforeach()
message(STATUS "Locale blacklist applied; Locales used: ${GETTEXT_USED_LOCALES}")
elseif (GETTEXTLIB_FOUND)
set(GETTEXT_USED_LOCALES ${GETTEXT_AVAILABLE_LOCALES})
endif()
# Set some optimizations and tweaks

View File

@ -239,21 +239,21 @@ inline u64 getTimeMs()
{
struct timespec ts;
os_get_clock(&ts);
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
return ((u64) ts.tv_sec) * 1000LL + ((u64) ts.tv_nsec) / 1000000LL;
}
inline u64 getTimeUs()
{
struct timespec ts;
os_get_clock(&ts);
return ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
return ((u64) ts.tv_sec) * 1000000LL + ((u64) ts.tv_nsec) / 1000LL;
}
inline u64 getTimeNs()
{
struct timespec ts;
os_get_clock(&ts);
return ts.tv_sec * 1000000000 + ts.tv_nsec;
return ((u64) ts.tv_sec) * 1000000000LL + ((u64) ts.tv_nsec);
}
#endif