Re: studio.h -> gamma_magick
Bob Friesenhahn <[email protected]> Wed, 19 Feb 2020 08:21:28 -0600 (CST)
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 19 Feb 2020, Pro Turm wrote: > I coudnt define the reason for the following line of code: > > studio.h -> #define gamma gamma_magick > > What is gamma_magick supposed to be about? This sort of thing is done to avoid conflicts with a symbol called 'gamma' which might be provided by the compiler or operating system. It appears that on some systems, there is a pre-processor symbol called 'gamma' and it conflicts with or redefines the 'gamma' member in the Image struct. Gamma is the name of a C'99 math function often declared in math.h. The compilers sometimes get confused if there is both a function and a structure member with the same name. Indeed, the similar re-declarations in studio.h are to avoid conflicts with standard symbols. Achieving broad portability requires dealing with such things. Bob -- Bob Friesenhahn [email protected], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt