]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix some Windows-related problems.
authorPeter Powell <petpow@saberuk.com>
Mon, 16 Dec 2013 02:39:31 +0000 (02:39 +0000)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 4 Jan 2014 18:31:29 +0000 (19:31 +0100)
- Fix an error relating to the unavailability of std::back_inserter.
- Fix loading configuration files when using relative paths.
- Fix two methods in hashcomp being exported twice.
- Remove some unimportant error messages.

include/compat.h
include/hashcomp.h
src/configparser.cpp
src/modules/m_spanningtree/utils.cpp

index 0357f54789eff25ef04ffed06e8e60e7513e65a6..fa75cd75434b228d8d96ed350acc509d7142cc51 100644 (file)
@@ -41,7 +41,6 @@
 #if defined __clang__ || defined __GNUC__
 # define CUSTOM_PRINTF(stringpos, firstpos) __attribute__((format(printf, stringpos, firstpos)))
 #else
 #if defined __clang__ || defined __GNUC__
 # define CUSTOM_PRINTF(stringpos, firstpos) __attribute__((format(printf, stringpos, firstpos)))
 #else
-# pragma message ("Warning! CUSTOM_PRINTF() does not work on your compiler!")
 # define CUSTOM_PRINTF(stringpos, firstpos)
 #endif
 
 # define CUSTOM_PRINTF(stringpos, firstpos)
 #endif
 
@@ -98,7 +97,6 @@
 #elif defined _MSC_VER
 # define DEPRECATED_METHOD(function) __declspec(deprecated) function
 #else
 #elif defined _MSC_VER
 # define DEPRECATED_METHOD(function) __declspec(deprecated) function
 #else
-# pragma message ("Warning! DEPRECATED_METHOD() does not work on your compiler!")
 # define DEPRECATED_METHOD(function) function
 #endif
 
 # define DEPRECATED_METHOD(function) function
 #endif
 
index ec1cc57649a2b1c901d487d300bbf5ac782135f3..0bf306267e43fcbc1e63f29dc71a39c3edae7f97 100644 (file)
@@ -148,7 +148,7 @@ namespace irc
                 * @return similar to strcmp, zero for equal, less than zero for str1
                 * being less and greater than zero for str1 being greater than str2.
                 */
                 * @return similar to strcmp, zero for equal, less than zero for str1
                 * being less and greater than zero for str1 being greater than str2.
                 */
-               static CoreExport int compare(const char* str1, const char* str2, size_t n);
+               static int compare(const char* str1, const char* str2, size_t n);
 
                /** Find a char within a string up to position n.
                 * @param s1 String to find in
 
                /** Find a char within a string up to position n.
                 * @param s1 String to find in
@@ -156,7 +156,7 @@ namespace irc
                 * @param c Character to search for
                 * @return Pointer to the first occurance of c in s1
                 */
                 * @param c Character to search for
                 * @return Pointer to the first occurance of c in s1
                 */
-               static CoreExport const char* find(const char* s1, int  n, char c);
+               static const char* find(const char* s1, int  n, char c);
        };
 
        /** This typedef declares irc::string based upon irc_char_traits.
        };
 
        /** This typedef declares irc::string based upon irc_char_traits.
index 0e2a8670631d836126a56baeaa6987e303efb6ac..e23d6ec435d44f5c6d30be96a79d3734b3ee3b55 100644 (file)
@@ -300,7 +300,7 @@ void ParseStack::DoInclude(ConfigTag* tag, int flags)
                        flags |= FLAG_NO_INC;
                if (tag->getBool("noexec", false))
                        flags |= FLAG_NO_EXEC;
                        flags |= FLAG_NO_INC;
                if (tag->getBool("noexec", false))
                        flags |= FLAG_NO_EXEC;
-               if (!ParseFile(name, flags, mandatorytag))
+               if (!ParseFile(ServerInstance->Config->Paths.PrependConfig(name), flags, mandatorytag))
                        throw CoreException("Included");
        }
        else if (tag->readString("executable", name))
                        throw CoreException("Included");
        }
        else if (tag->readString("executable", name))
@@ -344,13 +344,12 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int
        }
 }
 
        }
 }
 
-bool ParseStack::ParseFile(const std::string& name, int flags, const std::string& mandatory_tag)
+bool ParseStack::ParseFile(const std::string& path, int flags, const std::string& mandatory_tag)
 {
 {
-       std::string path = ServerInstance->Config->Paths.PrependConfig(name);
        ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Reading file %s", path.c_str());
        for (unsigned int t = 0; t < reading.size(); t++)
        {
        ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Reading file %s", path.c_str());
        for (unsigned int t = 0; t < reading.size(); t++)
        {
-               if (std::string(name) == reading[t])
+               if (path == reading[t])
                {
                        throw CoreException("File " + path + " is included recursively (looped inclusion)");
                }
                {
                        throw CoreException("File " + path + " is included recursively (looped inclusion)");
                }
index c9abbd0084ba4afd1dc98ff8f10faa3538a90426..dbd246ffe447ce96a2e38bba8e05297d80c8de10 100644 (file)
@@ -227,7 +227,7 @@ void SpanningTreeUtilities::RefreshIPCache()
                        continue;
                }
 
                        continue;
                }
 
-               std::copy(L->AllowMasks.begin(), L->AllowMasks.end(), std::back_inserter(ValidIPs));
+               ValidIPs.insert(ValidIPs.end(), L->AllowMasks.begin(), L->AllowMasks.end());
 
                irc::sockets::sockaddrs dummy;
                bool ipvalid = irc::sockets::aptosa(L->IPAddr, L->Port, dummy);
 
                irc::sockets::sockaddrs dummy;
                bool ipvalid = irc::sockets::aptosa(L->IPAddr, L->Port, dummy);