From: <jl...@us...> - 2010-04-11 01:21:36
|
Revision: 5112 http://hugin.svn.sourceforge.net/hugin/?rev=5112&view=rev Author: jlegg Date: 2010-04-11 01:21:30 +0000 (Sun, 11 Apr 2010) Log Message: ----------- Fix compilation of pano_modify on g++. getopt.h was needed for required_argument etc, but was not included due to a #ifdef WIN32. g++ will not use toupper as a unary function object due to its c++ overloads. Modified Paths: -------------- hugin/trunk/src/tools/pano_modify.cpp Modified: hugin/trunk/src/tools/pano_modify.cpp =================================================================== --- hugin/trunk/src/tools/pano_modify.cpp 2010-04-10 20:54:45 UTC (rev 5111) +++ hugin/trunk/src/tools/pano_modify.cpp 2010-04-11 01:21:30 UTC (rev 5112) @@ -30,9 +30,8 @@ #include <fstream> #include <sstream> -#ifdef WIN32 - #include <getopt.h> -#else +#include <getopt.h> +#ifndef WIN32 #include <unistd.h> #endif #include <panodata/Panorama.h> @@ -71,11 +70,17 @@ << endl; } +// toupper is overloaded in <locale>, but we want to use it as a unary function. +inline char toupper_2(char c) +{ + return toupper(c); +} + /** convert string to uppercase letters. */ std::string strToUpper(const std::string& aString) { std::string result(aString); - std::transform(aString.begin(), aString.end(), result.begin(), toupper); + std::transform(aString.begin(), aString.end(), result.begin(), toupper_2); return result; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |