- Properly set STDCALL as default convention, previous patch incorrectly set it as...
[reactos.git] / reactos / tools / rbuild / backend / msvc / msvcmaker.cpp
index 7eebcab..87cbc46 100644 (file)
 using std::string;
 using std::vector;
 
+#ifdef OUT
+#undef OUT
+#endif//OUT
+
 void
 MSVCBackend::_generate_dsp ( const Module& module )
 {
@@ -50,7 +54,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
 
        string module_type = GetExtension(module.GetTargetName());
        bool lib = (module_type == ".lib") || (module_type == ".a");
-       bool dll = (module_type == ".dll");
+       bool dll = (module_type == ".dll") || (module_type == ".cpl");
        bool exe = (module_type == ".exe");
        // TODO FIXME - need more checks here for 'sys' and possibly 'drv'?
 
@@ -257,25 +261,20 @@ MSVCBackend::_generate_dsp ( const Module& module )
        if ( !lib && !exe ) fprintf ( OUT, "MTL=midl.exe\r\n" );
        fprintf ( OUT, "RSC=rc.exe\r\n" );
 
-       int n = 0;
-
        std::string output_dir;
        for ( size_t icfg = 0; icfg < cfgs.size(); icfg++ )
        {
                std::string& cfg = cfgs[icfg];
-               if ( icfg )
+               if ( icfg == 0 )
                {
-                       if ( n == 0 )
-                       {
-                               fprintf ( OUT, "!IF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
-                               fprintf ( OUT, "\r\n" );
-                       }
-                       else
-                       {
-                               fprintf ( OUT, "\r\n" );
-                               fprintf ( OUT, "!ELSEIF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
-                               fprintf ( OUT, "\r\n" );
-                       }
+                       fprintf ( OUT, "!IF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
+                       fprintf ( OUT, "\r\n" );
+               }
+               else
+               {
+                       fprintf ( OUT, "\r\n" );
+                       fprintf ( OUT, "!ELSEIF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
+                       fprintf ( OUT, "\r\n" );
                }
 
                bool debug = !strstr ( cfg.c_str(), "Release" );
@@ -555,6 +554,7 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        // TODO FIXME - do we need their kludge?
                        //if ( module.name == "ntdll" ) fprintf ( OUT, " /nodefaultlib" ); // FIXME: Kludge
                        if ( dll ) fprintf ( OUT, " /def:\"%s.def\"", module.name.c_str() );
+                       if (( dll ) && ( module_type == ".cpl")) fprintf ( OUT, " /out:\"Win32\\%s%s\"", module.name.c_str(), module_type.c_str() );
                        if ( debug ) fprintf ( OUT, " /pdbtype:sept" );
                        fprintf ( OUT, "\r\n" );
                }
@@ -564,8 +564,6 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        fprintf ( OUT, "# ADD BASE LIB32 /nologo\r\n" );
                        fprintf ( OUT, "# ADD LIB32 /nologo\r\n" );
                }
-
-               n++;
        }
 
        if ( cfgs.size() != 0 )