diff --git a/CMakeLists.txt b/CMakeLists.txt index a819a61b5a..0b301da77d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -692,14 +692,6 @@ install(FILES ${gnucash_DOCS} DESTINATION ${CMAKE_INSTALL_DOCDIR}) # Create config.h -if (WIN32) - if (MINGW) - set (HAVE_SCANF_LLD 1) - else () - set (HAVE_SCANF_I64D 1) - endif() -endif() - check_include_files (dirent.h HAVE_DIRENT_H) check_include_files (dlfcn.h HAVE_DLFCN_H) check_include_files (glob.h HAVE_GLOB_H) @@ -764,7 +756,6 @@ set (HAVE_LINK 1) set (HAVE_LOCALTIME_R 1) set (HAVE_PTHREAD_MUTEX_INIT 1) set (HAVE_PTHREAD_PRIO_INHERIT 1) -set (HAVE_SCANF_LLD 1) set (HAVE_SETENV 1) set (HAVE_STPCPY 1) set (HAVE_STRPTIME 1) diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in index 5f70f809c6..c1dbec0866 100644 --- a/common/config.h.cmake.in +++ b/common/config.h.cmake.in @@ -153,15 +153,6 @@ /* If available, contains the Python version number currently in use. */ #cmakedefine HAVE_PYTHON 1 -/* Define if scanf supports %I64d conversions. */ -#cmakedefine HAVE_SCANF_I64D 1 - -/* Define if scanf supports %lld conversions. */ -#cmakedefine HAVE_SCANF_LLD 1 - -/* Define if scanf supports %qd conversions. */ -#cmakedefine HAVE_SCANF_QD 1 - /* Define to 1 if you have the `setenv' function. */ #cmakedefine HAVE_SETENV 1 diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c index a8de2e4084..025b9b6e21 100644 --- a/libgnucash/app-utils/gnc-ui-util.c +++ b/libgnucash/app-utils/gnc-ui-util.c @@ -1935,7 +1935,7 @@ xaccParseAmountInternal (const char * in_str, gboolean monetary, { *out = '\0'; - if (*out_str && sscanf(out_str, QOF_SCANF_LLD, &numer) < 1) + if (*out_str && sscanf(out_str, "%lld", &numer) < 1) next_state = NO_NUM_ST; else if (next_state == FRAC_ST) { @@ -1977,7 +1977,7 @@ xaccParseAmountInternal (const char * in_str, gboolean monetary, } long long int fraction; - if (sscanf (out_str, QOF_SCANF_LLD, &fraction) < 1) + if (sscanf (out_str, "%lld", &fraction) < 1) { g_free(out_str); return FALSE; diff --git a/libgnucash/backend/xml/sixtp-utils.cpp b/libgnucash/backend/xml/sixtp-utils.cpp index 3da4b1f121..0cf032b6ca 100644 --- a/libgnucash/backend/xml/sixtp-utils.cpp +++ b/libgnucash/backend/xml/sixtp-utils.cpp @@ -171,7 +171,7 @@ string_to_gint64 (const gchar* str, gint64* v) g_return_val_if_fail (str, FALSE); /* must use "<" here because %n's effects aren't well defined */ - if (sscanf (str, " " QOF_SCANF_LLD "%n", &v_in, &num_read) < 1) + if (sscanf (str, " %lld%n", &v_in, &num_read) < 1) { return (FALSE); } diff --git a/libgnucash/engine/qofutil.h b/libgnucash/engine/qofutil.h index ddbd39d2f0..579650e63f 100644 --- a/libgnucash/engine/qofutil.h +++ b/libgnucash/engine/qofutil.h @@ -45,21 +45,6 @@ extern "C" { #endif -/** Do not use these for printf, only scanf */ -#if HAVE_SCANF_LLD -# define QOF_SCANF_LLD "%lld" -#else -# if HAVE_SCANF_QD -# define QOF_SCANF_LLD "%qd" -# else -# if HAVE_SCANF_I64D -# define QOF_SCANF_LLD "%I64d" -# else -# error "No scanf format string is known for LLD. Fix your ./configure so that the correct one is detected!" -# endif -# endif -#endif - #define QOF_MOD_UTIL "qof.utilities" /** \name typedef enum as string macros