Skip to content

Commit

Permalink
Define _GNU_SOURCE at the top
Browse files Browse the repository at this point in the history
It is recommended to define _GNU_SOURCE at the top of the file instead
of defining __USE_GNU.
  • Loading branch information
norihiro committed Apr 7, 2024
1 parent f4e9b26 commit e402ce1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions obs-command-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

#if !defined(_WIN32) && !defined(__APPLE__)
#define _GNU_SOURCE // close_range for Linux
#endif

#include <obs-module.h>
#include <obs-frontend-api.h>
#include <util/platform.h>
Expand All @@ -26,8 +30,6 @@
#else
#ifdef __APPLE__
#include <libproc.h>
#else // Linux
#define __USE_GNU // close_range
#endif
#include <sys/stat.h>
#include <sys/wait.h>
Expand Down

0 comments on commit e402ce1

Please sign in to comment.