Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Commit

Permalink
fixed all compile issues. trunk is still highly unstable!
Browse files Browse the repository at this point in the history
  • Loading branch information
aidinabedi committed Dec 13, 2009
1 parent 47727b8 commit e2b3512
Show file tree
Hide file tree
Showing 16 changed files with 725 additions and 78 deletions.
199 changes: 199 additions & 0 deletions Samples/Simple/Demo_Simple.vcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="Demo_Simple"
ProjectGUID="{CE0B3567-5D70-4AA4-8F7C-29FE8E9CA7A3}"
RootNamespace="Demo_Simple"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ShinyDebug.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="../../lib"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Shiny.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../../lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\Simple.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
6 changes: 4 additions & 2 deletions Samples/Simple/Simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ int main() {

ProfileMe();

PROFILER_UPDATE(); // update all profiles
PROFILER_OUTPUT(); // print to cout
PROFILE_UPDATE(); // update all profiles
PROFILE_OUTPUT(stdout); // print to cout

system("pause");

return 0;
}
3 changes: 2 additions & 1 deletion include/Shiny.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ applications, and to alter it and redistribute it freely, subject to the followi

//-----------------------------------------------------------------------------

#include "ShinyConfig.h"
extern "C" {
#include "ShinyMacros.h"
#include "ShinyManager.h"
}

#endif // ifndef SHINY_*_H
1 change: 1 addition & 0 deletions include/ShinyData.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ applications, and to alter it and redistribute it freely, subject to the followi

#include "ShinyPrereqs.h"


//-----------------------------------------------------------------------------

typedef struct {
Expand Down
81 changes: 45 additions & 36 deletions include/ShinyMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,49 @@ applications, and to alter it and redistribute it freely, subject to the followi
//-----------------------------------------------------------------------------
// public preprocessors

#define PROFILE_UPDATE_ALL \
Shiny::ShinyManager::instance.update
#define PROFILE_UPDATE() \
ShinyManager_update(&Shiny_instance)

#define PROFILE_OUTPUT_ALL \
Shiny::ShinyManager::instance.output
#define PROFILE_SET_DAMPING(floatbetween0and1) \
Shiny_instance.damping = (floatbetween0and1);

#define PROFILE_GET_TREE_OUTPUT() \
Shiny::ShinyManager::instance.outputNodesAsString()
#define PROFILE_GET_DAMPING() \
(Shiny_instance.damping)

#define PROFILE_GET_FLAT_OUTPUT() \
Shiny::ShinyManager::instance.outputZonesAsString()
#define PROFILE_OUTPUT_FILE(filename) \
ShinyManager_outputToFile(&Shiny_instance, filename)

#define PROFILE_DESTROY_ALL() \
Shiny::ShinyManager::instance.destroy()
#define PROFILE_OUTPUT(stream) \
ShinyManager_outputToStream(&Shiny_instance, stream)

#define PROFILE_GET_TREE_STRING() \
ShinyManager_outputNodesToString(&Shiny_instance)

#define PROFILE_GET_FLAT_STRING() \
ShinyManager_outputZonesToString(&Shiny_instance)

#define PROFILE_DESTROY() \
ShinyManager_destroy(&Shiny_instance)

#define PROFILE_CLEAR() \
Shiny::ShinyManager::instance.clear()
ShinyManager_clear(&Shiny_instance)

#define PROFILE_SORT_ZONES() \
Shiny::ShinyManager::instance.sortZones()
ShinyManager_sortZones(&Shiny_instance)


//-----------------------------------------------------------------------------
// public preprocessor

#define PROFILE_GET_ROOT_DATA() \
Shiny::ShinyManager::instance.rootZone.data
Shiny_instance.rootZone.data


//-----------------------------------------------------------------------------
// public preprocessor

#define PROFILE_END() \
ShinyManager_endCurNode(Shiny_instance)
ShinyManager_endCurNode(&Shiny_instance)


//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -162,7 +171,7 @@ applications, and to alter it and redistribute it freely, subject to the followi

#if SHINY_HAS_ENABLED == TRUE
#define PROFILE_SET_ENABLED( boolean ) \
Shiny::ShinyManager::instance.enabled = boolean
Shiny_instance.enabled = boolean
#endif


Expand All @@ -181,8 +190,8 @@ applications, and to alter it and redistribute it freely, subject to the followi

#define _PROFILE_ZONE_DEFINE( id, string ) \
\
Shiny::ShinyZone id = { \
NULL, SHINY_ZONE_STATE_HIDDEN, string, \
ShinyZone id = { \
NULL, SHINY_ZONE_STATE_HIDDEN, string, \
{ { 0, 0 }, { 0, 0 }, { 0, 0 } } \
}

Expand All @@ -192,46 +201,46 @@ applications, and to alter it and redistribute it freely, subject to the followi

#define _PROFILE_ZONE_DECLARE( prefix, id ) \
\
prefix Shiny::ShinyZone id
prefix ShinyZone id


//-----------------------------------------------------------------------------
// internal preprocessor

#define _PROFILE_BLOCK_DEFINE( id ) \
\
Shiny::ShinyEndNodeOnDestruction SHINY_UNUSED id
ShinyEndNodeOnDestruction SHINY_UNUSED id


//-----------------------------------------------------------------------------
// internal preprocessor

#define _PROFILE_ZONE_BEGIN( id ) \
{ \
static Shiny::ProfileNodeCache cache = \
&ShinyNode_dummy; \
static ProfileNodeCache cache = \
&_ShinyNode_dummy; \
\
ShinyManager_lookupAndBeginNode(Shiny_instance, &cache, &id); \
ShinyManager_lookupAndBeginNode(&Shiny_instance, &cache, &id); \
}

//-----------------------------------------------------------------------------

#else // #if SHINY_COMPILED == TRUE

namespace Shiny {

SHINY_INLINE ShinyData GetEmptyData() {
ShinyData a = { { 0, 0 }, { 0, 0 }, { 0, 0 } };
return a;
}
SHINY_INLINE ShinyData GetEmptyData() {
ShinyData a = { { 0, 0 }, { 0, 0 }, { 0, 0 } };
return a;
}

#define PROFILE_UPDATE_ALL(...)
#define PROFILE_OUTPUT_ALL(...)
#define PROFILE_CLEAR(...)
#define PROFILE_GET_TREE_OUTPUT() std::string()
#define PROFILE_GET_FLAT_OUTPUT() std::string()
#define PROFILE_DESTROY_ALL ()
#define PROFILE_UPDATE()
#define PROFILE_SET_DAMPING(x)
#define PROFILE_GET_DAMPING() 0.0f
#define PROFILE_OUTPUT_FILE(x)
#define PROFILE_OUTPUT(x)
#define PROFILE_CLEAR()
#define PROFILE_GET_TREE_STRING() std::string()
#define PROFILE_GET_FLAT_STRING() std::string()
#define PROFILE_DESTROY()
#define PROFILE_BEGIN(name)
#define PROFILE_BLOCK(name)
#define PROFILE_FUNC()
Expand All @@ -241,8 +250,8 @@ namespace Shiny {
#define PROFILE_SHARED_DEFINE(name)
#define PROFILE_SHARED_BEGIN(name)
#define PROFILE_SHARED_BLOCK(name)
#define PROFILE_GET_SHARED_DATA(name) Shiny::GetEmptyData()
#define PROFILE_GET_ROOT_DATA() Shiny::GetEmptyData()
#define PROFILE_GET_SHARED_DATA(name) ShinyGetEmptyData()
#define PROFILE_GET_ROOT_DATA() ShinyGetEmptyData()

#if SHINY_HAS_ENABLED == TRUE
#define PROFILE_SET_ENABLED(boolean)
Expand Down
Loading

0 comments on commit e2b3512

Please sign in to comment.