Merge lp:~dcow90/myro-c++/extern-c into lp:myro-c++

Proposed by David Cowden
Status: Merged
Approved by: John Hoare
Approved revision: 84
Merged at revision: 100
Proposed branch: lp:~dcow90/myro-c++/extern-c
Merge into: lp:myro-c++
Diff against target: 12 lines (+1/-1)
1 file modified
headers/Scribbler.h (+1/-1)
To merge this branch: bzr merge lp:~dcow90/myro-c++/extern-c
Reviewer Review Type Date Requested Status
John Hoare Approve
Review via email: mp+66661@code.launchpad.net

Description of the change

The change is described in detail in the commit. I changed one function prototype so it is compatible with the use of extern "C" (I believe that was the issue). My guess is, when using extern "C", functions overloaded with a void version and a null string version:

function();

and

function (string s = "");

break down both into the same signature to the compiler. Which is why the compiler was complaining.

Simply changing the prototype to:

function (string s);

fixes the error and allows us to compile against the Scribbler header.

Please feel free to ask any questions. This was a confusing error to come across and one that didn't manifest until recently and under special conditions so I may need to explain it better.

To post a comment you must log in.
Revision history for this message
John Hoare (jhoare) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'headers/Scribbler.h'
--- headers/Scribbler.h 2011-06-28 01:17:27 +0000
+++ headers/Scribbler.h 2011-07-01 21:08:32 +0000
@@ -433,7 +433,7 @@
433 * @return An integer represent the light intensity for the specified433 * @return An integer represent the light intensity for the specified
434 * window.434 * window.
435 */435 */
436 int getBright(std::string value = ""); 436 int getBright(std::string value);
437437
438 /**438 /**
439 * Used to query a specified light sensor located on the rear of the439 * Used to query a specified light sensor located on the rear of the

Subscribers

People subscribed via source and target branches