Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
CodeSnippets using nonstandard C++
(1/1)
Pecan:
http://forums.codeblocks.org/index.php/topic,8595.msg64869.html#msg64869
Re: Multi File editing
Moved here from "Multi File editing" thread:
--- Quote from: Pecan on August 19, 2008, 02:00:29 am ---What part of CodeSnippets is nonstandard C++ ?
Maybe we can fix that if we knew what you mean.
--- End quote ---
DrewBoo said:
In memorymappedfile.cpp, you'll see that every function has separate Windows code and Linux code. It follows this pattern:
--- Code: ---#ifdef __WXMSW__
// (Code intended to build in Windows)
#else
// (Code intended to build in Linux)
#endif
--- End code ---
Since __WXMSW__ is not defined, my build blows up trying to build Linux-specific code.
--- Code: ---../memorymappedfile.cpp: In member function 'long int wxMemoryMappedFile::MapFile(const wxString&, bool)':
../memorymappedfile.cpp:107: error: 'open' was not declared in this scope
../memorymappedfile.cpp:124: error: 'MAP_FILE' was not declared in this scope
--- End code ---
Thought #1: Does wxWindows include a file operation API so we can outright eliminate this fragile code?
Thought #2: I've read that MAP_FILE is legacy and is #defined as 0. Can someone verify this?
I don't know what this would break on other platforms, but I'm adding this code to the file and am trying a build now....
--- Code: ---#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
--- End code ---
Pecan:
I've found a way around this.
CodeSnippets will no longer need the memory mapped file code.
I'll commit after I run the code for some days.
DrewBoo:
--- Quote from: Pecan on August 20, 2008, 01:07:05 am ---I've found a way around this.
CodeSnippets will no longer need the memory mapped file code.
I'll commit after I run the code for some days.
--- End quote ---
Nice, Pecan.
DrewBoo:
--- Quote from: Pecan on August 20, 2008, 01:07:05 am ---I've found a way around this.
CodeSnippets will no longer need the memory mapped file code.
I'll commit after I run the code for some days.
--- End quote ---
I saw the drop, Pecan. Awesome.
I'll be able to test it Monday-ish.
Navigation
[0] Message Index
Go to full version