mingw makefile + more mingw compatibility fixes
authorRoyce Mitchell III <royce3@ev1.net>
Fri, 19 Aug 2005 21:53:40 +0000 (21:53 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Fri, 19 Aug 2005 21:53:40 +0000 (21:53 +0000)
svn path=/trunk/; revision=17445

irc/ArchBlackmann/ArchBlackmann.cpp
irc/ArchBlackmann/makefile [new file with mode: 0644]

index 6132bbf..1d71f74 100644 (file)
@@ -203,12 +203,13 @@ public:
        }
        bool OnPart ( const std::string& user, const std::string& channel )
        {
        }
        bool OnPart ( const std::string& user, const std::string& channel )
        {
-               for ( int i = 0; i < ops.size(); i++ )
+               std::vector<std::string>::iterator it = ops.begin();
+               for ( ; it != ops.end(); it++ )
                {
                {
-                       if ( ops[i] == user )
+                       if ( *it == user )
                        {
                                printf ( "remove '%s' to ops list\n", user.c_str() );
                        {
                                printf ( "remove '%s' to ops list\n", user.c_str() );
-                               ops.erase ( &ops[i] );
+                               ops.erase ( it );
                        }
                }
                return true;
                        }
                }
                return true;
@@ -394,15 +395,17 @@ public:
                                                return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
                                        s = string ( p, p2-p );
                                }
                                                return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
                                        s = string ( p, p2-p );
                                }
-                               for ( i = 0; i < list.list.size(); i++ )
+                               std::vector<std::string>::iterator it = list.list.begin();
+                               for ( ; it != list.list.end(); it++ )
                                {
                                {
-                                       if ( list.list[i] == s )
+                                       if ( *it == s )
                                        {
                                        {
-                                               list.list.erase ( &list.list[i] );
+                                               list.list.erase ( it );
                                                {
                                                {
-                                                               File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
-                                                       for ( i = 0; i < list.list.size(); i++ )
-                                                               f.printf ( "%s\n", list.list[i].c_str() );
+                                                       File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
+                                                       it = list.list.begin();
+                                                       for ( ; it < list.list.end(); it++ )
+                                                               f.printf ( "%s\n", it->c_str() );
                                                }
                                                return PrivMsg ( channel, ssprintf("%s: entry removed from list '%s'",from.c_str(),listname.c_str()) );
                                        }
                                                }
                                                return PrivMsg ( channel, ssprintf("%s: entry removed from list '%s'",from.c_str(),listname.c_str()) );
                                        }
@@ -480,12 +483,13 @@ public:
                                {
                                        if ( *p == 'o' )
                                        {
                                {
                                        if ( *p == 'o' )
                                        {
-                                               for ( int i = 0; i < ops.size(); i++ )
+                                               std::vector<std::string>::iterator it = ops.begin();
+                                               for ( ; it != ops.end(); it++ )
                                                {
                                                {
-                                                       if ( ops[i] == target )
+                                                       if ( *it == target )
                                                        {
                                                                printf ( "remove '%s' to ops list\n", target.c_str() );
                                                        {
                                                                printf ( "remove '%s' to ops list\n", target.c_str() );
-                                                               ops.erase ( &ops[i] );
+                                                               ops.erase ( it );
                                                        }
                                                }
                                                break;
                                                        }
                                                }
                                                break;
diff --git a/irc/ArchBlackmann/makefile b/irc/ArchBlackmann/makefile
new file mode 100644 (file)
index 0000000..bb38adf
--- /dev/null
@@ -0,0 +1,32 @@
+TARGET := ArchBlackmann.exe\r
+\r
+.PHONY: all\r
+\r
+all: $(TARGET)\r
+\r
+CFLAGS := -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS\r
+LFLAGS :=\r
+LIBS := -lstdc++ -lws2_32\r
+\r
+SRCS := ArchBlackmann.cpp \\r
+       base64.cpp \\r
+       chomp.cpp \\r
+       cram_md5.cpp \\r
+       File.cpp \\r
+       IRCClient.cpp \\r
+       MD5.cpp \\r
+       panic.cpp \\r
+       ReliMT.cpp \\r
+       SockUtils.cpp \\r
+       SplitJoin.cpp \\r
+       ssprintf.cpp \\r
+       ThreadPool.cpp \\r
+       trim.cpp\r
+\r
+OBJS := $(SRCS:.cpp=.o)\r
+\r
+$(TARGET): $(OBJS)\r
+       g++ $(LFLAGS) -o $@ $(OBJS) $(LIBS)\r
+\r
+.cpp.o: $<\r
+       g++ $(CFLAGS) -c $< -o $@\r