Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename iraf subincludes #275

Merged
merged 3 commits into from
Apr 14, 2023
Merged

Conversation

olebole
Copy link
Member

@olebole olebole commented Apr 5, 2023

The names of (some) subincludes of hlib$libc/iraf.h conflict with standard C library names, which has the danger to include the wrong file. Since the subincludes are meant to be included via

#define import_spp
#include <iraf.h>

instead of

#include <spp.h>

the file names are not part of the public interface, so we can safely rename them.
Internally, this requires to adjust a number of dependencies to these files, however.

Another change made by the PR is that the logic of avoiding double-includes changed. In the original, iraf.h did this:

#ifndef D_stdio
#include "iraf/stdio.h"
#endif

and the #define D_stdio was in stdio.h, while now everything is in the included file:

#ifndef D_iraf_stdio_h
#define D_iraf_stdio_h#endif /* D_iraf_stdio_h */

which is the standard way.
This makes it easier to include files in included files, which will help when the header files are restructured.

@olebole olebole force-pushed the rename_iraf_subincludes branch 3 times, most recently from 5c04f15 to 33a0f41 Compare April 13, 2023 15:26
This is to finally avoid name clashes with the standard includes
This makes the inclusion more robust; especially when one includes
another one.
@olebole olebole merged commit df0bdb3 into iraf-community:main Apr 14, 2023
@olebole olebole deleted the rename_iraf_subincludes branch April 14, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant