Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/tools/impdef/ImpDef.cpp

    r8002 r21916  
    1414#include <string.h>
    1515#include <stdlib.h>
     16
     17#include <string>
     18#include <set>
    1619
    1720#include "kTypes.h"
     
    186189static long processFile(const char *pszInput, const char *pszOutput, const POPTIONS pOptions)
    187190{
     191    std::set<std::string> exports;
     192
    188193    long lRc = 0;
    189194
     
    197202            {
    198203                kFile * pOutput = new kFile(pszOutput, FALSE);
    199                 kExportEntry export;
     204                kExportEntry exp;
    200205
    201206                /* generate LIBRARY line */
     
    210215
    211216                /* Exports */
    212                 if (pDefFile->exportFindFirst(&export))
     217                if (pDefFile->exportFindFirst(&exp))
    213218                {
    214219                    pOutput->printf("EXPORTS\n");
    215220                    do
    216221                    {
    217                         char        szName[MAXEXPORTNAME];
     222                        char        szName[MAXEXPORTNAME + 2 /*quotes*/];
    218223                        const char *pszName;
    219224
    220225                        /* validate export struct */
    221                         if (export.achName[0] == '\0')
     226                        if (exp.achName[0] == '\0')
    222227                        {
    223228                            kFile::StdErr.printf(
    224229                                "Warning export name is missing.\n"
    225230                                "info:\texport.achIntName=%s\n\texport.achName=%s\n\texport.ulOrdinal=%ld\n",
    226                                 export.achIntName, export.achName, export.ulOrdinal);
     231                                exp.achIntName, exp.achName, exp.ulOrdinal);
    227232                            continue;
    228233                        }
    229                         if (export.ulOrdinal == ~0UL)
     234                        if (exp.ulOrdinal == ~0UL)
    230235                        {
    231236                            kFile::StdErr.printf(
    232237                                "warning: export is missing ordinal value. Export is ignored\n"
    233238                                "info:\texport.achIntName=%s\n\texport.achName=%s\n\texport.ulOrdinal=%ld\n",
    234                                     export.achIntName, export.achName, export.ulOrdinal);
     239                                    exp.achIntName, exp.achName, exp.ulOrdinal);
    235240                            continue;
    236241                        }
    237242
    238243                        /* real work */
    239                         pszName = generateExportName(&export, &szName[0], pOptions);
    240 
    241                         pOutput->printf("    %-*s  @%ld\n", 40, pszName, export.ulOrdinal);
    242                     } while (pDefFile->exportFindNext(&export));
     244                        pszName = generateExportName(&exp, &szName[1], pOptions);
     245                        if (exports.count(pszName) == 0) {
     246                            exports.insert(pszName);
     247                            szName[0] = '"';
     248                            strcat(szName, "\"");
     249                            pszName = szName;
     250
     251                            pOutput->printf("    %-*s  @%ld\n", 40, pszName, exp.ulOrdinal);
     252                        }
     253                    } while (pDefFile->exportFindNext(&exp));
    243254                pOutput->setSize();
    244255                delete pOutput;
Note: See TracChangeset for help on using the changeset viewer.