mingw makefile + more mingw compatibility fixes
Modified: trunk/irc/ArchBlackmann/ArchBlackmann.cpp
Added: trunk/irc/ArchBlackmann/makefile
  _____
Modified: trunk/irc/ArchBlackmann/ArchBlackmann.cpp
--- trunk/irc/ArchBlackmann/ArchBlackmann.cpp   2005-08-19 21:21:58 UTC
(rev 17444)
+++ trunk/irc/ArchBlackmann/ArchBlackmann.cpp   2005-08-19 21:53:40 UTC
(rev 17445)
@@ -203,12 +203,13 @@
        }
        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() );
-                               ops.erase ( &ops[i] );
+                               ops.erase ( it );
                        }
                }
                return true;
@@ -394,15 +395,17 @@
                                                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()) );
                                        }
@@ -480,12 +483,13 @@
                                {
                                        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() );
-
ops.erase ( &ops[i] );
+
ops.erase ( it );
                                                        }
                                                }
                                                break;
  _____
Added: trunk/irc/ArchBlackmann/makefile
--- trunk/irc/ArchBlackmann/makefile    2005-08-19 21:21:58 UTC (rev
17444)
+++ trunk/irc/ArchBlackmann/makefile    2005-08-19 21:53:40 UTC (rev
17445)
@@ -0,0 +1,32 @@
+TARGET := ArchBlackmann.exe
+
+.PHONY: all
+
+all: $(TARGET)
+
+CFLAGS := -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS
+LFLAGS :=
+LIBS := -lstdc++ -lws2_32
+
+SRCS := ArchBlackmann.cpp \
+       base64.cpp \
+       chomp.cpp \
+       cram_md5.cpp \
+       File.cpp \
+       IRCClient.cpp \
+       MD5.cpp \
+       panic.cpp \
+       ReliMT.cpp \
+       SockUtils.cpp \
+       SplitJoin.cpp \
+       ssprintf.cpp \
+       ThreadPool.cpp \
+       trim.cpp
+
+OBJS := $(SRCS:.cpp=.o)
+
+$(TARGET): $(OBJS)
+       g++ $(LFLAGS) -o $@ $(OBJS) $(LIBS)
+
+.cpp.o: $<
+       g++ $(CFLAGS) -c $< -o $@
    
    
    
    
    
 
                    
                    
                        
                        Show replies by date