Skip to content

Commit

Permalink
Couple bug fixes, stricmp crap, & version number
Browse files Browse the repository at this point in the history
Fixed a case where the compiler would report the incorrect file and line
number for a OBJ keyword not in the first column.
Made another attempt at resolving the madness that is stricmp/strcasecmp
in GCC which changed with 4.8 and newer builds of GCC.
Added Version to the banner printout. We are currently version 1.00.70.
the 70 is the build number. I'll be incrementing that whenever I do a
build. I'll attempt to tag the source whenever I do a build.
  • Loading branch information
reltham committed Mar 11, 2014
1 parent 4f2dc81 commit 0f8f553
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions PropellerCompiler/PropellerCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,10 @@ bool CompileObjBlocksId()
}
}
}
else
{
return false;
}
}
return true;
}
Expand Down
11 changes: 11 additions & 0 deletions PropellerCompiler/PropellerCompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
#ifndef _PROPELLER_COMPILER_H_
#define _PROPELLER_COMPILER_H_

//
// OpenSpin code uses _stricmp() which is the VC++ name for the function.
// this needs to be remapped to stricmp or strcasecmp depending on the compiler and OS being compiled on
// GCC prior to version 4.8 have strcasecmp on both linux and windows
// GCC 4.8 and newer on linux appears to still have strcasecmp, but GCC 4.8 and newer on windows does not (it has stricmp instead)
//
#if defined(__linux__)
// we are on linux, then always use strcasecmp
#define _stricmp strcasecmp
#else
#if __GNUC__
// if GCC version is 4.8 or greater use stricmp, else use strcasecmp
#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 8 ))
Expand All @@ -21,6 +31,7 @@
#define _stricmp strcasecmp
#endif
#endif
#endif

//
// Everything here needs to stay in the order it is in (for the enums and struct) and remain
Expand Down
13 changes: 8 additions & 5 deletions SpinSource/openspin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static char s_filesAccessed[MAX_FILES][PATH_MAX];
static void Banner(void)
{
fprintf(stdout, "Propeller Spin/PASM Compiler \'OpenSpin\' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.\n");
fprintf(stdout, "Compiled on %s %s\n",__DATE__, __TIME__);
fprintf(stdout, "Version 1.00.70 Compiled on %s %s\n",__DATE__, __TIME__);
}

/* Usage - display a usage message and exit */
Expand Down Expand Up @@ -473,10 +473,13 @@ void ComposeRAM(unsigned char** ppBuffer, int& bufferSize, bool bDATonly, bool b
void CleanupMemory()
{
// cleanup
delete [] s_pCompilerData->list;
delete [] s_pCompilerData->doc;
delete [] s_pCompilerData->obj;
delete [] s_pCompilerData->source;
if ( s_pCompilerData )
{
delete [] s_pCompilerData->list;
delete [] s_pCompilerData->doc;
delete [] s_pCompilerData->obj;
delete [] s_pCompilerData->source;
}
CleanObjectHeap();
CleanupPathEntries();
Cleanup();
Expand Down

0 comments on commit 0f8f553

Please sign in to comment.