Ignore:
Timestamp:
Oct 29, 2011, 4:27:13 PM (14 years ago)
Author:
dmik
Message:

Make tools/common library build.

Location:
branches/gcc-kmk/tools/common
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/tools/common/kError.cpp

    r8003 r21759  
    1616*   Header Files                                                               *
    1717*******************************************************************************/
     18#ifdef __EMX__
     19#define __OS2DEF__
     20#define OS2EMX_PLAIN_CHAR
     21#endif
    1822#include <os2.h>
     23
    1924#include <string.h>
    2025#include <stdio.h>
  • branches/gcc-kmk/tools/common/kFile.cpp

    r8003 r21759  
    1919*   Header Files                                                               *
    2020*******************************************************************************/
     21#ifdef __EMX__
     22#define __OS2DEF__
     23#define OS2EMX_PLAIN_CHAR
     24#endif
    2125#include <os2.h>
    2226
     
    4549 * @remark
    4650 */
    47 KBOOL   kFile::refreshFileStatus()
     51KBOOL   kFile::refreshFileStatus() throw (kError)
    4852{
    4953    if (fStdDev)
     
    6872 * @returns     Success indicator.
    6973 */
    70 KBOOL   kFile::position()
     74KBOOL   kFile::position() throw (kError)
    7175{
    7276    /*
     
    254258 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    255259 */
    256 kFile::kFile(const char *pszFilename, KBOOL fReadOnly/*=TRUE*/)
     260kFile::kFile(const char *pszFilename, KBOOL fReadOnly/*=TRUE*/) throw (kError)
    257261:   fReadOnly(fReadOnly),
    258262    fStatusClean(FALSE),
     
    332336 * @param       cbBuffer    Amount of bytes to read.
    333337 */
    334 int             kFile::read(void *pvBuffer, long cbBuffer)
     338int             kFile::read(void *pvBuffer, long cbBuffer) throw (kError)
    335339{
    336340    ULONG   cbRead;
     
    427431 * @param       off         Absolute file offset.
    428432 */
    429 int             kFile::readAt(void *pvBuffer, long cbBuffer, long off)
     433int             kFile::readAt(void *pvBuffer, long cbBuffer, long off) throw (kError)
    430434{
    431435    if (set(off))
     
    477481 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    478482 */
    479 int             kFile::readln(char *pszBuffer, long cchBuffer) throw(kError)
     483int             kFile::readln(char *pszBuffer, long cchBuffer)
    480484{
    481485    long    cbRead;
     
    558562 * @param       cbBuffer    Amount of bytes to write.
    559563 */
    560 int             kFile::write(const void *pv, long cb)
     564int             kFile::write(const void *pv, long cb) throw (kError)
    561565{
    562566    if (fReadOnly)
     
    678682 * @param       off         Absolute file offset.
    679683 */
    680 int             kFile::writeAt(const void *pvBuffer, long cbBuffer, long off)
     684int             kFile::writeAt(const void *pvBuffer, long cbBuffer, long off) throw (kError)
    681685{
    682686    if (set(off))
     
    788792 * @param       off     Relative reposition.
    789793 */
    790 int             kFile::move(long off)
     794int             kFile::move(long off) throw (kError)
    791795{
    792796    if ((off + offVirtual) & 0x80000000UL) /* above 2GB or negative */
     
    814818 * @param       off     New file position.
    815819 */
    816 int             kFile::set(long off)
     820int             kFile::set(long off) throw (kError)
    817821{
    818822    if (off < 0)
     
    839843 * @remark      Will only throw error if refreshFileStatus failes.
    840844 */
    841 int             kFile::end()
     845int             kFile::end() throw (kError)
    842846{
    843847    if (!refreshFileStatus())
     
    872876 * @remark      Will only throw error if refreshFileStatus failes.
    873877 */
    874 long            kFile::getSize()
     878long            kFile::getSize() throw (kError)
    875879{
    876880    if (!refreshFileStatus())
     
    886890 * @remark      Will only throw error if refreshFileStatus failes.
    887891 */
    888 long            kFile::getPos() const
     892long            kFile::getPos() const throw (kError)
    889893{
    890894    return offVirtual;
     
    898902 * @remark      Will only throw error if refreshFileStatus failes.
    899903 */
    900 KBOOL           kFile::isEOF()
     904KBOOL           kFile::isEOF() throw (kError)
    901905{
    902906    #if 0
     
    954958 * @remark  May throw errors.
    955959 */
    956 void *kFile::mapFile(const char *pszFilename)
     960void *kFile::mapFile(const char *pszFilename) throw (kError)
    957961{
    958962    kFile file(pszFilename);
     
    968972 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    969973 */
    970 void kFile::mapFree(void *pvFileMapping)
     974void kFile::mapFree(void *pvFileMapping) throw (kError)
    971975{
    972976    if (pvFileMapping)
  • branches/gcc-kmk/tools/common/kFileDef.cpp

    r9164 r21759  
    119119
    120120
    121 kFileDef::kFileDef(kFile *pFile) :
     121kFileDef::kFileDef(kFile *pFile) throw (kError) :
    122122    kFileFormatBase(pFile),
    123123    pszType(NULL), pszModName(NULL), pszBase(NULL), pszCode(NULL), pszData(NULL), pszDescription(NULL),
     
    137137 * Destructor. Frees used memory.
    138138 */
    139 kFileDef::~kFileDef()
     139kFileDef::~kFileDef() throw (kError)
    140140{
    141141    if (pszType        != NULL) delete pszType;
     
    182182 * @remark  throws errorcode on error (TODO: errorhandling)
    183183 */
    184 void kFileDef::read(kFile *pFile)
     184void kFileDef::read(kFile *pFile) throw (kError)
    185185{
    186186    char *pszTmp;
     
    445445 * @remark    tabs are expanded. string is trimmed. comments removed.
    446446 */
    447 char *kFileDef::readln(kFile *pFile, char *pszBuffer, int cbBuffer)
     447char *kFileDef::readln(kFile *pFile, char *pszBuffer, int cbBuffer) throw (kError)
    448448{
    449449    int i;
     
    700700 * @remark
    701701 */
    702 KBOOL kFileDef::makeWatcomLinkFileAddtion(kFile *pOut, int enmOS)
     702KBOOL kFileDef::makeWatcomLinkFileAddtion(kFile *pOut, int enmOS) throw(kError)
    703703{
    704704    PDEFSEGMENT pSeg;
  • branches/gcc-kmk/tools/common/kFileDef.h

    r9162 r21759  
    105105        /**@cat Constructor/Destructor */
    106106        kFileDef(kFile *pFile) throw(kError);
    107         virtual ~kFileDef();
     107        virtual ~kFileDef() throw (kError);
    108108
    109109        /** @cat Module information methods. */
  • branches/gcc-kmk/tools/common/kFileFormatBase.cpp

    r8003 r21759  
    3030 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    3131 */
    32 kFileFormatBase::kFileFormatBase(kFile *pFile)
     32kFileFormatBase::kFileFormatBase(kFile *pFile) throw (kError)
    3333    : pFile(pFile)
    3434{
     
    4242 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    4343 */
    44 kFileFormatBase::~kFileFormatBase()
     44kFileFormatBase::~kFileFormatBase() throw (kError)
    4545{
    4646    if (pFile)
  • branches/gcc-kmk/tools/common/kFileLX.cpp

    r8003 r21759  
    256256 * @param     pszFilename   LX executable image name.
    257257 */
    258 kFileLX::kFileLX(const char *pszFilename) :
     258kFileLX::kFileLX(const char *pszFilename) throw (kError) :
    259259    kFileFormatBase(NULL), pvBase(NULL)
    260260{
     
    292292 * @param     pFile     Pointer to opened LX file.
    293293 */
    294 kFileLX::kFileLX(kFile *pFile) :
     294kFileLX::kFileLX(kFile *pFile) throw (kError) :
    295295    kFileFormatBase(pFile), pvBase(NULL)
    296296{
     
    330330 * Destructor.
    331331 */
    332 kFileLX::~kFileLX()
     332kFileLX::~kFileLX() throw (kError)
    333333{
    334334    if (pvBase != NULL)
  • branches/gcc-kmk/tools/common/kFileLX.h

    r8003 r21759  
    2222    kFileLX(const char *pszFilename) throw (kError);
    2323    kFileLX(kFile *pFile) throw (kError);
    24     ~kFileLX();
     24    ~kFileLX() throw (kError);
    2525
    2626    /** @cat Module information methods. */
  • branches/gcc-kmk/tools/common/kFilePE.cpp

    r8003 r21759  
    3636 * @remark    throws errorcode
    3737 */
    38 kFilePE::kFilePE(kFile *pFile) :
     38kFilePE::kFilePE(kFile *pFile) throw (kError) :
    3939    kFileFormatBase(pFile),
    4040    pvBase(NULL),
     
    9393
    9494                    /* read sections */
    95                     for (int i = 0; i < pehdr.FileHeader.NumberOfSections; i++)
     95                    int i;
     96                    for (i = 0; i < pehdr.FileHeader.NumberOfSections; i++)
    9697                    {
    9798           unsigned long  cbSection;
     
    148149 * Destructor.
    149150 */
    150 kFilePE::~kFilePE()
     151kFilePE::~kFilePE() throw (kError)
    151152{
    152153    if (pvBase)
  • branches/gcc-kmk/tools/common/kFilePE.h

    r8003 r21759  
    6767    public:
    6868        kFilePE(kFile *pFile) throw (kError);
    69         virtual ~kFilePE();
     69        virtual ~kFilePE() throw (kError);
    7070
    7171        /** @cat Module information methods. */
  • branches/gcc-kmk/tools/common/kFileSDF.cpp

    r8003 r21759  
    6767 *
    6868 */
    69 void kFileSDF::parseSDFFile(void *pvFile)
     69void kFileSDF::parseSDFFile(void *pvFile) throw (kError)
    7070{
    7171    /*
     
    160160 * @remark  Will throw error codes.
    161161 */
    162 kFileSDF::kFileSDF(kFile *pFile) :
     162kFileSDF::kFileSDF(kFile *pFile) throw (kError) :
    163163    kFileFormatBase(pFile), papStructs(NULL), pHdr(NULL), paTypes(NULL)
    164164{
     
    205205
    206206
    207 kFileSDF::~kFileSDF()
     207kFileSDF::~kFileSDF() throw (kError)
    208208{
    209209    if (papStructs);
  • branches/gcc-kmk/tools/common/kFileSDF.h

    r8003 r21759  
    8181public:
    8282    kFileSDF(kFile *pFile) throw (kError);
    83     ~kFileSDF();
     83    ~kFileSDF() throw (kError);
    8484
    8585    /** @cat Debug Type information methods. */
  • branches/gcc-kmk/tools/common/kTypes.h

    r21350 r21759  
    5454
    5555/*******************************************************************************
     56*   GNU C++ Compilers                                                       *
     57*******************************************************************************/
     58#ifdef __GNUC__
     59
     60    #define INLINE      static inline
     61    #define KLIBCALL    _Optlink
     62    INLINE void INT3() { __asm__ __volatile__ ("int3\n\tnop"); }
     63
     64    typedef unsigned long KSIZE;
     65    typedef unsigned long KBOOL;
     66
     67#endif
     68
     69
     70/*******************************************************************************
    5671*   Common stuff                                                               *
    5772*******************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.