Hi Robert,

it seems Ulrich used the functions to convert from and to network byte
order (big endian).
On Windows you have to include <Winsock2.h> and probably also to link to
Ws2_32.lib.
On unix like systems you probably have to include <arpa/inet.h>
(on some systems you have to include <netinet/in.h>).

Best regards,
Blasius



Robert Osfield wrote:
> Hi Ulrich,
>
> Thanks for the changes.  I've just attempted a merge but got an compile error:
>
> /home/robert/OpenSceneGraph/src/osgPlugins/bmp/ReaderWriterBMP.cpp: In
> function 'unsigned char* bmp_load(std::istream&, int&, int&, int&)':
> /home/robert/OpenSceneGraph/src/osgPlugins/bmp/ReaderWriterBMP.cpp:174:
> error: 'ntohs' was not declared in this scope
> /home/robert/OpenSceneGraph/src/osgPlugins/bmp/ReaderWriterBMP.cpp: In
> function 'bool bmp_save(const osg::Image&, std::ostream&)':
> /home/robert/OpenSceneGraph/src/osgPlugins/bmp/ReaderWriterBMP.cpp:500:
> error: 'htons' was not declared in this scope
>
>
> On the line:
>
>         bmp.magic = ntohs(bmp.magic);
>
> And:
>
>         bmp.magic = htons(BMP_MAGIC_BM);
>
> I haven't come across these functions before so don't know where to
> look for a solution, a missing include?
>
> Robert.
>
> On Sat, Nov 22, 2008 at 4:13 AM, Ulrich Hertlein <[EMAIL PROTECTED]> wrote:
>   
>> On 21/11/08 4:29 AM, Robert Osfield wrote:
>>     
>>> I've just reviewed your bmp fixes and note that you've kept the old
>>> code in place but effectively #ifdef'd out.  Given the function that
>>> you've replace is rather long I think it would be a easy to make
>>>       
>> Attached is a cleaned-up version of the BMP reader/writer.
>> /ulrich
>>
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>>
>>     
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>   

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to