Re: Constants

[email protected]
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
On 2010-01-04 20:36:55, Chris Robinson wrote:
> On Monday 04 January 2010 7:16:41 pm 

> A cross-compiler should produce code that is compatible with the target 
> system, not the host. If Windows specifies an enum being one value, and Linux 
> uses another, for example, then both MinGW on Windows and MinGW on Linux would 
> produce code according to what Windows says the value is. There'd be no 
> problem cross-compiling an OpenAL app for Win32 if Win32 uses different 
> constant values, as long as the cross-compiler is using proper Windows-based 
> headers.

'Lo,

What I meant was:

Assume I need to find the value of a constant at library compile time (when I
compile my language bindings). I might have a program in the build that does
something like:

al_format_mono8.c:

#include <stdio.h>
#include <AL/al.h>

int
main (void)
{
  printf ("AL_FORMAT_MONO8 %lu\n", AL_FORMAT_MONO8);
  return 0;
}

al_format_mono8: al_format_mono8.c
  cc -o al_format_mono8 al_format_mono8.c

constants.dat: al_format_mono8
  ./al_format_mono8 > constants.dat

This obviously wouldn't be possible if cross compiling as it wouldn't be
possible to run the compiled al_format_mono8 program (and if it was compiled
to run on the host, it might produce the wrong value if the host al.h and
target al.h differed in that respect).

M
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.