|
From: Shang M. <smu...@gm...> - 2007-11-13 19:07:44
|
I applied the patch to the svn, except the #include issue.
The <> include directives are generated from .ice files by the
slice2cpp program of Ice. I do not quite understand their choice, but
what i did is I included "." in the include searching path.
Ice even discourages use of "" includes in .ice files. From Ice documentation:
'''
Note that you should avoid #include with double quotes:
#include "Clock.ice" // Not recommended!
While double quotes will work, the directory in which the preprocessor tries to
locate the file can vary depending on the operating system, so the included file
may not always be found where you expect it. Instead, use angle brackets (<>);
you can control which directories are search for the file with the -I
option of the
Slice compiler (see page 169).
'''
And there is a section talking about the generation of include
directives in C++ focusing on the path of the header file in the
generated files, for example #include <include/a.h>.
If you feel those are nonsense, we probably should bring those issues
up on Ice's forum.
Shang
On 11/12/07, Jonathan Merritt <me...@un...> wrote:
> Hi Guys,
>
> I have submitted a first patch to the tracker (Request ID 1830252).
> I'm not sure how you will apply the patch under Windows, but the
> normal UNIX patch command is:
> patch -p0 < patch
> This should be run when the patch file is in the root directory. You
> can do a dry-run using:
> patch --dry-run -p0 < patch
> (Also note, it's safest NOT to do this on a working copy that has
> local changes. The safest way is to check out a fresh working copy,
> apply the patch, review it, and then commit. You can then merge those
> committed changes into your own working copy with an svn up. Please
> disregard if you're experienced with patching.)
>
> Can you please check that this patch doesn't break anything for the
> Windows build, and then commit it? I will start working on the
> Windows-specific filesystem stuff in the JTMVCModel directory next.
>
> This patch addresses the following three problems in the JTMVCModel
> directory:
>
> 1. Use of "" vs <> in #include directives. For project-specific
> headers, the use of double-quotation marks "" rather than angled
> brackets <> is more typical. The use of angled brackets for project-
> specific headers causes problems for g++.
>
> 2. Passing temporary objects by non-const reference. Consider below:
>
> The following C++ program is illegal (according to the actual
> standard). The main() function attempts to pass a temporary
> std::string object by non-const reference.
> === START CODE ===
> #include <iostream>
> void printString(std::string &myString) {
> std::cout << myString << std::endl;
> }
> std::string makeString() {
> return std::string("Hello World!");
> }
> int main (int argc, char * const argv[]) {
> printString(makeString());
> }
> === END CODE ===
>
> The program can be made legal either by explicitly instantiating the
> std::string object (making it appear on the stack) or by using a const-
> reference. The use of a const reference is illustrated below:
> === START CODE ===
> #include <iostream>
> void printString(const std::string &myString) {
> std::cout << myString << std::endl;
> }
> std::string makeString() {
> return std::string("Hello World!");
> }
> int main (int argc, char * const argv[]) {
> printString(makeString());
> // OR, put the string on the stack:
> // std::string s = makeString();
> // printString(s);
> }
> === END CODE ===
>
> I have changed the passing of JTHint in CObservableObserver::Notify()
> to const. If this will not work (i.e. if JTHint is actually
> modified), then the code can be fixed by following this pattern for
> JTHint passing:
> Change:
> Notify( HintGen(JT_Activity_ALL), this, caller);
> To:
> JTHint hint = HintGen(JT_Activity_ALL);
> Notify(hint, this, caller);
> (Or something similar that actually places a JTHint on the stack.)
>
> C++ is a complicated language, and Microsoft do NOT make things easier
> by allowing non-standard behavior! :-(
>
> 3. The "typename" keyword is required in a couple of places. I don't
> fully understand this one myself, but the g++ errors indicated the fix.
>
> Jonathan Merritt.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Jointtrack-devel mailing list
> Joi...@li...
> https://lists.sourceforge.net/lists/listinfo/jointtrack-devel
>
|