From 7ce87a2ec32f1d6d11a4d152869b2bc99442d1de Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 12 Apr 2010 12:59:44 -0700 Subject: [PATCH] Added windows/VS stuff --- .hgignore | 3 + pycdas.cpp | 10 +- pycdas.vcproj | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++ pycdc.sln | 26 +++++ pycdc.vcproj | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 pycdas.vcproj create mode 100644 pycdc.sln create mode 100644 pycdc.vcproj diff --git a/.hgignore b/.hgignore index be93074..d1a2587 100644 --- a/.hgignore +++ b/.hgignore @@ -1,4 +1,7 @@ .*\.o +.*\.vcproj.*\.user +.*\.ncb +.*\.suo bin/pycdas bin/pycdc ^test/ diff --git a/pycdas.cpp b/pycdas.cpp index 998367c..79f1725 100644 --- a/pycdas.cpp +++ b/pycdas.cpp @@ -153,6 +153,12 @@ void output_object(PycRef obj, PycModule* mod, int indent) } } +#ifdef WIN32 +# define PATHSEP '\\' +#else +# define PATHSEP '/' +#endif + int main(int argc, char* argv[]) { if (argc < 2) { @@ -162,7 +168,9 @@ int main(int argc, char* argv[]) PycModule mod; mod.loadFromFile(argv[1]); - printf("%s (Python %d.%d%s)\n", argv[1], mod.majorVer(), mod.minorVer(), + const char* dispname = strrchr(argv[1], PATHSEP); + dispname = (dispname == NULL) ? argv[1] : dispname + 1; + printf("%s (Python %d.%d%s)\n", dispname, mod.majorVer(), mod.minorVer(), (mod.majorVer() < 3 && mod.isUnicode()) ? " -U" : ""); output_object(mod.code().cast(), &mod, 0); diff --git a/pycdas.vcproj b/pycdas.vcproj new file mode 100644 index 0000000..e202fc6 --- /dev/null +++ b/pycdas.vcproj @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pycdc.sln b/pycdc.sln new file mode 100644 index 0000000..1fea23c --- /dev/null +++ b/pycdc.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pycdc", "pycdc.vcproj", "{44A92B47-DFE6-4C07-B8D0-5D78C0ECCA21}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pycdas", "pycdas.vcproj", "{102E5FEA-A879-4F26-B803-526B5D62F750}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {44A92B47-DFE6-4C07-B8D0-5D78C0ECCA21}.Debug|Win32.ActiveCfg = Debug|Win32 + {44A92B47-DFE6-4C07-B8D0-5D78C0ECCA21}.Debug|Win32.Build.0 = Debug|Win32 + {44A92B47-DFE6-4C07-B8D0-5D78C0ECCA21}.Release|Win32.ActiveCfg = Release|Win32 + {44A92B47-DFE6-4C07-B8D0-5D78C0ECCA21}.Release|Win32.Build.0 = Release|Win32 + {102E5FEA-A879-4F26-B803-526B5D62F750}.Debug|Win32.ActiveCfg = Debug|Win32 + {102E5FEA-A879-4F26-B803-526B5D62F750}.Debug|Win32.Build.0 = Debug|Win32 + {102E5FEA-A879-4F26-B803-526B5D62F750}.Release|Win32.ActiveCfg = Release|Win32 + {102E5FEA-A879-4F26-B803-526B5D62F750}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pycdc.vcproj b/pycdc.vcproj new file mode 100644 index 0000000..7c29cb7 --- /dev/null +++ b/pycdc.vcproj @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +