Skip to content

Commit

Permalink
Always #include <ruby.h> before any system header.
Browse files Browse the repository at this point in the history
* Fixes #88,
  the issue explains it in details.
* `#include "extconf.h"` is redundant and a code smell for missing ruby.h,
  ruby/internal/config.h already does `#include RUBY_EXTCONF_H`.
  • Loading branch information
eregon committed Jan 8, 2024
1 parent 7686214 commit b3952ce
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions ext/io/event/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

#include <ruby.h>

#include "extconf.h"

void Init_IO_Event(void);

#ifdef HAVE_LIBURING_H
Expand Down
2 changes: 1 addition & 1 deletion ext/io/event/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#include "extconf.h"
#include <ruby.h>

#ifdef HAVE_SYS_EVENTFD_H
struct IO_Event_Interrupt {
Expand Down
1 change: 1 addition & 0 deletions ext/io/event/selector/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

// Provides a simple implementation of unique pointers to elements of the given size.

#include <ruby.h>
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
Expand Down
1 change: 1 addition & 0 deletions ext/io/event/selector/list.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Released under the MIT License.
// Copyright, 2023, by Samuel Williams.

#include <ruby.h>
#include <stdio.h>
#include <assert.h>

Expand Down
2 changes: 2 additions & 0 deletions ext/io/event/selector/pidfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#include <ruby.h>

#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
Expand Down

0 comments on commit b3952ce

Please sign in to comment.