diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index e12e4a347..44d24b23a 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -23,7 +23,7 @@ libdesmume_a_SOURCES = \ firmware.cpp firmware.h GPU.cpp GPU.h \ GPU_osd.h \ mem.h mc.cpp mc.h \ - path.h \ + path.cpp path.h \ readwrite.cpp readwrite.h \ wifi.cpp wifi.h \ mic.h \ diff --git a/desmume/src/debug.cpp b/desmume/src/debug.cpp index ac1c40d64..1fd2f9c75 100644 --- a/desmume/src/debug.cpp +++ b/desmume/src/debug.cpp @@ -1,21 +1,18 @@ /* Copyright (C) 2008 Guillaume Duhamel Copyright (C) 2009-2010 DeSmuME team - This file is part of DeSmuME + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. - DeSmuME is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - DeSmuME is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DeSmuME; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU General Public License + along with the this software. If not, see . */ #include "debug.h" diff --git a/desmume/src/path.cpp b/desmume/src/path.cpp new file mode 100644 index 000000000..1197d5856 --- /dev/null +++ b/desmume/src/path.cpp @@ -0,0 +1,59 @@ +/* Copyright 2009-2010 DeSmuME team + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the this software. If not, see . +*/ + +#include "types.h" + +#include "path.h" +#include + + +//----------------------------------- +#ifdef _WINDOWS +void FCEUD_MakePathDirs(const char *fname) +{ + char path[MAX_PATH]; + const char* div = fname; + + do + { + const char* fptr = strchr(div, '\\'); + + if(!fptr) + { + fptr = strchr(div, '/'); + } + + if(!fptr) + { + break; + } + + int off = fptr - fname; + strncpy(path, fname, off); + path[off] = '\0'; + mkdir(path); + + div = fptr + 1; + + while(div[0] == '\\' || div[0] == '/') + { + div++; + } + + } while(1); +} +#endif +//------------------------------ \ No newline at end of file diff --git a/desmume/src/path.h b/desmume/src/path.h index 3119148a2..a46e4bec5 100644 --- a/desmume/src/path.h +++ b/desmume/src/path.h @@ -21,7 +21,11 @@ #endif #if defined(_WINDOWS) +#include +#include #include +#include "winutil.h" +#include "common.h" #if !defined(WXPORT) #include "resource.h" #else @@ -34,6 +38,10 @@ #include "time.h" #include "utils/xstring.h" +#ifdef _WINDOWS +void FCEUD_MakePathDirs(const char *fname); +#endif + //----------------------------------- //This is taken from mono Path.cs static const char InvalidPathChars[] = { @@ -70,43 +78,6 @@ public: (!dirEqualsVolume && path.size() > 1 && path [1] == VolumeSeparatorChar)); } }; -//----------------------------------- -#if defined(_WINDOWS) -static void FCEUD_MakePathDirs(const char *fname) -{ - char path[MAX_PATH]; - const char* div = fname; - - do - { - const char* fptr = strchr(div, '\\'); - - if(!fptr) - { - fptr = strchr(div, '/'); - } - - if(!fptr) - { - break; - } - - int off = fptr - fname; - strncpy(path, fname, off); - path[off] = '\0'; - mkdir(path); - - div = fptr + 1; - - while(div[0] == '\\' || div[0] == '/') - { - div++; - } - - } while(1); -} -#endif -//------------------------------ class PathInfo { diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index 84a06f2a6..db2fb4f81 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -2156,6 +2156,10 @@ RelativePath="..\OGLRender.h" > + + diff --git a/desmume/src/windows/DeSmuME_2008.vcproj b/desmume/src/windows/DeSmuME_2008.vcproj index c3ae0e6ab..68f5e850a 100644 --- a/desmume/src/windows/DeSmuME_2008.vcproj +++ b/desmume/src/windows/DeSmuME_2008.vcproj @@ -858,6 +858,10 @@ RelativePath="..\OGLRender.h" > + + diff --git a/desmume/src/windows/DeSmuME_2010.vcxproj b/desmume/src/windows/DeSmuME_2010.vcxproj index 4e0b9d271..59312fa06 100644 --- a/desmume/src/windows/DeSmuME_2010.vcxproj +++ b/desmume/src/windows/DeSmuME_2010.vcxproj @@ -462,6 +462,7 @@ + diff --git a/desmume/src/windows/DeSmuME_2010.vcxproj.filters b/desmume/src/windows/DeSmuME_2010.vcxproj.filters index 9cc46b2ca..a96a32289 100644 --- a/desmume/src/windows/DeSmuME_2010.vcxproj.filters +++ b/desmume/src/windows/DeSmuME_2010.vcxproj.filters @@ -435,6 +435,9 @@ Core\utils\libfat + + Core +