Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - EvanM

Pages: [1]
1
Audio / Re: Audio Library Pre-Processor Help
« on: November 30, 2018, 03:50:40 pm »
Lately, I've been going back over c++ to get a real fundamental understanding of what is happening and why certain methods are used. There is no goal, I just like knowing everything that happens in a piece of code (low-level understanding). From what I have been able to dig up, AL_LIBTYPE_STATIC is defined in the pre-processor settings in microsoft VS if using a static library. These pre processor directives check to see if this is defined or not when the project is built, if it isn't it tries to check if there is a dynamic library defined. I am not really concerned with licensing as this is a more read and learn project.

2
Audio / Audio Library Pre-Processor Help
« on: November 29, 2018, 10:47:06 pm »
#ifndef AL_AL_H
#define AL_AL_H

#if defined(__cplusplus)
extern "C" {
#endif

#ifndef AL_API
 #if defined(AL_LIBTYPE_STATIC)
  #define AL_API
 #elif defined(_WIN32)
  #define AL_API __declspec(dllimport)
 #else
  #define AL_API extern
 #endif
#endif

#if defined(_WIN32)
 #define AL_APIENTRY __cdecl
#else
 #define AL_APIENTRY
#endif
 

This is probably a simple question but I have been struggling to understand the first 22 lines of al.h in SFML/extlibs/headers/AL/al.h. Specifically line 9, or #if defined(AL_LIBTYPE_STATIC). I am not seeing AL_LIBTYPE_STATIC ever being defined in this whole SFML project, where is this coming from? Is this something that comes up through the linker? What are these lines doing? I understand preprocessor directives and their use but this is something I have not quite seen before. Thanks.

Pages: [1]