summaryrefslogtreecommitdiffstats
path: root/src/kvilib
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2026-02-20 23:38:28 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2026-02-22 20:26:55 +0900
commita09cecfffd5151adfc50e343c821ed8ebdd1ab87 (patch)
tree41b97f6dfceb7170df01f9d1aa7aeb5e01103e20 /src/kvilib
parentc4566646d9e7c8e69c28e445d5006ab1d881df41 (diff)
downloadkvirc-a09cecfffd5151adfc50e343c821ed8ebdd1ab87.tar.gz
kvirc-a09cecfffd5151adfc50e343c821ed8ebdd1ab87.zip
Some generic fixes required for future cmake conversion
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/kvilib')
-rw-r--r--src/kvilib/config/kvi_wincfg.h12
-rw-r--r--src/kvilib/core/kvi_error.cpp7
-rw-r--r--src/kvilib/net/kvi_dns.cpp13
-rw-r--r--src/kvilib/system/kvi_env.cpp2
-rw-r--r--src/kvilib/system/kvi_env.h10
5 files changed, 3 insertions, 41 deletions
diff --git a/src/kvilib/config/kvi_wincfg.h b/src/kvilib/config/kvi_wincfg.h
index 0e634dd9..84f590a3 100644
--- a/src/kvilib/config/kvi_wincfg.h
+++ b/src/kvilib/config/kvi_wincfg.h
@@ -76,12 +76,6 @@
/* define if you have the SIOCGIFADDR ioctl and the related headers */
/* #undef COMPILE_GET_INTERFACE_ADDRESS */
-/* define if you have the getenv function */
-/* #undef HAVE_GETENV */
-
-/* define if you have the strerror function */
-#define HAVE_STRERROR 1
-
/* define if you have the inet_aton function */
/* #define HAVE_INET_ATON 1 */
@@ -94,9 +88,6 @@
/* define if you have the inet_ntop function */
/* #undef HAVE_INET_NTOP */
-/* define if you have the getnameinfo function */
-#define HAVE_GETNAMEINFO
-
/* define if you have the getaddrinfo function */
#define HAVE_GETADDRINFO
@@ -115,9 +106,6 @@
/* define this if you want to disable the inter-process communication support */
/* #undef COMPILE_NO_IPC */
-/* Define if you have the `getenv' function. */
-/* #undef HAVE_GETENV */
-
/* Define if you have the <linux/soundcard.h> header file. */
/* #undef HAVE_LINUX_SOUNDCARD_H */
diff --git a/src/kvilib/core/kvi_error.cpp b/src/kvilib/core/kvi_error.cpp
index 2786984b..fa4af021 100644
--- a/src/kvilib/core/kvi_error.cpp
+++ b/src/kvilib/core/kvi_error.cpp
@@ -36,10 +36,7 @@
#endif
#include <errno.h>
-
-#ifdef HAVE_STRERROR
-#include <string.h> // for strerror()
-#endif
+#include <string.h>
// FIXME: This stuff should basically die and be eventually replaced with some
// helper functions for handling ONLY system errors.
@@ -177,9 +174,7 @@ namespace KviError
{
if((iErrorCode < KVI_NUM_ERRORS) && (iErrorCode >= 0))
return g_errorTable[iErrorCode];
-#ifdef HAVE_STRERROR
if(iErrorCode < 0)return strerror(-iErrorCode);
-#endif
return g_errorTable[KviError_unknownError];
}
diff --git a/src/kvilib/net/kvi_dns.cpp b/src/kvilib/net/kvi_dns.cpp
index c6f2612c..f4e8d8c9 100644
--- a/src/kvilib/net/kvi_dns.cpp
+++ b/src/kvilib/net/kvi_dns.cpp
@@ -220,9 +220,6 @@ void KviDnsThread::run()
#else //!COMPILE_ON_WINDOWS || COMPILE_IPV6_SUPPORT
int retVal;
-
-
-//#ifdef HAVE_GETNAMEINFO
struct sockaddr_in ipv4Addr;
#ifdef COMPILE_IPV6_SUPPORT
@@ -236,8 +233,6 @@ void KviDnsThread::run()
if(!bIsIpV4Ip)bIsIpV6Ip = KviNetUtils::stringIpToBinaryIp_V6(m_szQuery,(struct in6_addr *)&(ipv6Addr.sin6_addr));
#endif
-//#ifdef HAVE_GETNAMEINFO
-
#ifdef COMPILE_IPV6_SUPPORT
if(bIsIpV4Ip || bIsIpV6Ip)
{
@@ -271,12 +266,7 @@ void KviDnsThread::run()
}
} else {
-//#endif //HAVE_GETNAMEINFO
-
-//#ifdef COMPILE_IPV6_SUPPORT
-// struct in6_addr in6Addr;
-//#endif
struct addrinfo * pRet = 0;
struct addrinfo * pNext;
struct addrinfo hints;
@@ -334,10 +324,7 @@ void KviDnsThread::run()
}
}
if(pRet)freeaddrinfo(pRet);
-//#ifdef HAVE_GETNAMEINFO
}
-//#endif //HAVE_GETNAMEINFO
-
#endif // !COMPILE_ON_WINDOWS
diff --git a/src/kvilib/system/kvi_env.cpp b/src/kvilib/system/kvi_env.cpp
index 1497632e..7905feb5 100644
--- a/src/kvilib/system/kvi_env.cpp
+++ b/src/kvilib/system/kvi_env.cpp
@@ -23,8 +23,6 @@
//=============================================================================
#define __KVILIB__
-#define _KVI_ENV_CPP_
-
#include "kvi_env.h"
#include "kvi_string.h"
#include "kvi_malloc.h"
diff --git a/src/kvilib/system/kvi_env.h b/src/kvilib/system/kvi_env.h
index b3b24a2f..00ab8c0d 100644
--- a/src/kvilib/system/kvi_env.h
+++ b/src/kvilib/system/kvi_env.h
@@ -37,21 +37,15 @@
inline char * kvi_getenv(const char * name)
{
-#ifdef HAVE_GETENV
return getenv(name);
-#else
- return 0;
-#endif
}
#ifdef COMPILE_ON_WINDOWS
#define kvi_setenv(__name,__value) SetEnvironmentVariable(__name,__value)
#define kvi_unsetenv(__name) SetEnvironmentVariable(__name,NULL)
#else
- #ifndef _KVI_ENV_CPP_
- KVILIB_API extern bool kvi_setenv(const char * name,const char * value);
- KVILIB_API extern void kvi_unsetenv(const char * name);
- #endif
+ KVILIB_API extern bool kvi_setenv(const char * name,const char * value);
+ KVILIB_API extern void kvi_unsetenv(const char * name);
#endif