Skip to content

Commit

Permalink
Fix to build latest version of ThorsSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Loki-Astari committed Sep 20, 2024
1 parent 5a81f63 commit 4b8355e
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build
9 changes: 6 additions & 3 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@
/* We have found package ZLIB */
#undef HAVE_ZLIB

/* Check for older build tools and use simpler code with old tools */
#undef HOMEBREW_OLD_VERSION_OF_MAC

/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR

/* "Get mongosh version into #define. That way we can turn off some tests" */
#undef MONGO_MAJOR_VERSION

/* Check for older build tools and use simpler code with old tools */
#undef NO_STD_SUPPORT_FROM_CHAR_DOUBLE

/* Check for older build tools and use simpler code with old tools */
#undef NO_STD_SUPPORT_TO_CHAR_DOUBLE

/* Name of package */
#undef PACKAGE

Expand Down
72 changes: 66 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5792,19 +5792,18 @@ if ac_fn_cxx_try_compile "$LINENO"
then :


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Supports std::to_chars(beigin, end, 12.4" >&5
printf "%s\n" "$as_me: Supports std::to_chars(beigin, end, 12.4" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Supports std::to_chars(begin, end, double)" >&5
printf "%s\n" "$as_me: Supports std::to_chars(begin, end, double)" >&6;}


else case e in #(
e)

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Setting HOMEBREW_OLD_VERSION_OF_MAC" >&5
printf "%s\n" "$as_me: Setting HOMEBREW_OLD_VERSION_OF_MAC" >&6;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Setting NO_STD_SUPPORT_TO_CHAR_DOUBLE" >&5
printf "%s\n" "$as_me: Setting NO_STD_SUPPORT_TO_CHAR_DOUBLE" >&6;}

printf "%s\n" "#define HOMEBREW_OLD_VERSION_OF_MAC 1" >>confdefs.h
printf "%s\n" "#define NO_STD_SUPPORT_TO_CHAR_DOUBLE 1" >>confdefs.h

subconfigure="${subconfigure} --with-homebrewCLT=${with_homebrewCLT}"



Expand All @@ -5819,6 +5818,67 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi


if test "
#include <charconv>
int main() {
char buffer[] = "12.345";
double value;
auto result = std::from_chars(buffer, buffer+100, value);
}" != ""
then :

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Checking Compiler Compatibility ${CXX} ${CXX_STD_FLAG}" >&5
printf %s "checking Checking Compiler Compatibility ${CXX} ${CXX_STD_FLAG}... " >&6; }
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

CXXFLAGS_SAVE="${CXXFLAGS}"
CXXFLAGS=${CXX_STD_FLAG}

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <charconv>
int main() {
char buffer[] = "12.345";
double value;
auto result = std::from_chars(buffer, buffer+100, value);
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Supports std::from_chars(begin, end, double)" >&5
printf "%s\n" "$as_me: Supports std::from_chars(begin, end, double)" >&6;}


else case e in #(
e)

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Setting NO_STD_SUPPORT_FROM_CHAR_DOUBLE" >&5
printf "%s\n" "$as_me: Setting NO_STD_SUPPORT_FROM_CHAR_DOUBLE" >&6;}

printf "%s\n" "#define NO_STD_SUPPORT_FROM_CHAR_DOUBLE 1" >>confdefs.h




;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
CXXFLAGS=${CXXFLAGS_SAVE}



fi





case `pwd` in
Expand Down
23 changes: 19 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,29 @@ int main() {
auto result = std::to_chars(buffer, buffer+100, value, std::chars_format::fixed, 6);
}]],
[
AC_MSG_NOTICE([Supports std::to_chars(beigin, end, 12.4])
AC_MSG_NOTICE([[Supports std::to_chars(begin, end, double)]])
],
[
AC_MSG_NOTICE([Setting HOMEBREW_OLD_VERSION_OF_MAC])
AC_DEFINE([HOMEBREW_OLD_VERSION_OF_MAC], [1], [Check for older build tools and use simpler code with old tools])
subconfigure="${subconfigure} --with-homebrewCLT=${with_homebrewCLT}"
AC_MSG_NOTICE([Setting NO_STD_SUPPORT_TO_CHAR_DOUBLE])
AC_DEFINE([NO_STD_SUPPORT_TO_CHAR_DOUBLE], [1], [Check for older build tools and use simpler code with old tools])
]
)
AX_THOR_FUNC_TEST_COMP_ACTION([[
#include <charconv>
int main() {
char buffer[] = "12.345";
double value;
auto result = std::from_chars(buffer, buffer+100, value);
}]],
[
AC_MSG_NOTICE([[Supports std::from_chars(begin, end, double)]])
],
[
AC_MSG_NOTICE([Setting NO_STD_SUPPORT_FROM_CHAR_DOUBLE])
AC_DEFINE([NO_STD_SUPPORT_FROM_CHAR_DOUBLE], [1], [Check for older build tools and use simpler code with old tools])
]
)


LT_INIT

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

THORSANVIL_ROOT = $(realpath ../)

TARGET = ThorsLogging ThorsIOUtil Serialize ThorsStorage ThorsCrypto ThorsSocket ThorsMongo
TARGET = ThorsLogging ThorsIOUtil fast_float Serialize ThorsCrypto ThorsStorage ThorsSocket ThorsMongo

include $(THORSANVIL_ROOT)/build/tools/Project.Makefile

Expand Down
1 change: 1 addition & 0 deletions src/fast_float
2 changes: 1 addition & 1 deletion third/ThorsMongoAPI
2 changes: 1 addition & 1 deletion third/ThorsSerializer

0 comments on commit 4b8355e

Please sign in to comment.