Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) (Not work with bmp - plugin/bmp (UPP 10694, 64bit, GCC, C++11))
FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47402] Thu, 12 January 2017 09:50 Go to next message
SergeA is currently offline  SergeA
Messages: 5
Registered: October 2015
Location: Ukraine
Promising Member
Correct in bmphdr.h

........
//#ifdef COMPILER_MSC
#pragma pack(push, 1)
//#endif
........
........
........
//#ifdef COMPILER_MSC
#pragma pack(pop)
//#endif
........
Re: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47447 is a reply to message #47402] Tue, 17 January 2017 11:02 Go to previous messageGo to next message
SergeA is currently offline  SergeA
Messages: 5
Registered: October 2015
Location: Ukraine
Promising Member
//Fix in bmphdr.h

#ifndef _nImage__bmp_h_
#define _nImage__bmp_h_

//#ifdef COMPILER_MSC
#if defined(COMPILER_MSC) || defined(COMPILER_MINGW)
#pragma pack(push, 1)
#endif

..........

//#ifdef COMPILER_MSC
#if defined(COMPILER_MSC) || defined(COMPILER_MINGW)
#pragma pack(pop)
#endif

struct BMPHeader : public BMP_INFOHEADER
{
	BMP_RGB palette[256];
};

#endif

Re: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47449 is a reply to message #47447] Tue, 17 January 2017 16:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 10978
Registered: November 2005
Ultimate Member
Thanks, good catch. It is most likely mingw bug, as the issue should be managed by __attribute__((pack)), but no reason not to fix it this way...
Re: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47473 is a reply to message #47449] Fri, 20 January 2017 14:37 Go to previous messageGo to next message
SergeA is currently offline  SergeA
Messages: 5
Registered: October 2015
Location: Ukraine
Promising Member
upp-mingw-10732, file upp\uppsrc\plugin\bmp\bmphdr.h

Hello!
I'm not sure that it is necessary to specify COMPILER_GCC here.
#if defined(COMPILER_MSC) || defined(COMPILER_GCC)
#pragma pack(push, 1)
#endif

..........

//#ifdef COMPILER_MSC
#if defined(COMPILER_MSC) || defined(COMPILER_GCC)
#pragma pack(pop)
#endif


Rather MINGW as he sharpened by compatibility with visualc therefore likely
#if defined(COMPILER_MSC) || defined(COMPILER_MINGW)
#pragma pack(push, 1)
#endif

..........

//#ifdef COMPILER_MSC
#if defined(COMPILER_MSC) || defined(COMPILER_MINGW)
#pragma pack(pop)
#endif

[Updated on: Fri, 20 January 2017 14:41]

Report message to a moderator

Re: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47475 is a reply to message #47473] Fri, 20 January 2017 18:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 10978
Registered: November 2005
Ultimate Member
SergeA wrote on Fri, 20 January 2017 14:37
upp-mingw-10732, file upp\uppsrc\plugin\bmp\bmphdr.h

Hello!
I'm not sure that it is necessary to specify COMPILER_GCC here.
#if defined(COMPILER_MSC) || defined(COMPILER_GCC)
#pragma pack(push, 1)
#endif


Well, it does not hurt either. It appears to be GCC feature, not just mingw.

https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/Structure-Packi ng-Pragmas.html
Re: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47476 is a reply to message #47475] Fri, 20 January 2017 21:27 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 423
Registered: September 2012
Location: Poland, Kraków
Senior Member
Hello,

So, if GCC supports #pragma push, pop should we have following code now (Used several times in bmphdr.h!):
#ifdef COMPILER_GCC
__attribute__((packed))
#endif


I think it could be redundant, but I am not sure - so I am waiting for your opinion.

Sincerely,
Klugier


Ultimate++ - one framework to rule them all.
Re: FileSelPreview - No previews bmp files (UPP 10694, 64bit, GCC, C++11) [message #47484 is a reply to message #47476] Sat, 21 January 2017 12:45 Go to previous message
mirek is currently offline  mirek
Messages: 10978
Registered: November 2005
Ultimate Member
Klugier wrote on Fri, 20 January 2017 21:27
Hello,

So, if GCC supports #pragma push, pop should we have following code now (Used several times in bmphdr.h!):
#ifdef COMPILER_GCC
__attribute__((packed))
#endif


I think it could be redundant, but I am not sure - so I am waiting for your opinion.

Sincerely,
Klugier


Not sure. In these matters all I can say: if it does work, do not break it.

Perhaps some compiler version has attribute working and pack pragma not. Or vice versa. Current MINGW certainly has attribute broken...
Previous Topic: Incorrect header in ppm.h
Next Topic: capture mouse and limit all events to window
Goto Forum:
  


Current Time: Wed Apr 26 07:56:38 CEST 2017

Total time taken to generate the page: 0.18697 seconds