Skip to content

Commit

Permalink
nacl: add FreeBSD support
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Sep 16, 2024
1 parent 04fb7ca commit 4cedce5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion libs/nacl/native_client/src/include/atomic_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include "native_client/src/include/nacl_base.h"

#if defined(__native_client__) || NACL_LINUX
#if defined(__native_client__) || NACL_LINUX || NACL_FREEBSD
#include "native_client/src/include/gcc/atomic_ops.h"
#elif NACL_OSX
#include "native_client/src/include/osx/atomic_ops_osx.h"
Expand Down
4 changes: 2 additions & 2 deletions libs/nacl/native_client/src/include/nacl_asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
#if NACL_OSX
# define IDENTIFIER(n) _##n
#elif NACL_LINUX
#elif NACL_LINUX || NACL_FREEBSD
# define IDENTIFIER(n) n
#elif NACL_WINDOWS
# if defined(_WIN64)
Expand All @@ -30,7 +30,7 @@

#if NACL_OSX
# define HIDDEN(n) .private_extern IDENTIFIER(n)
#elif NACL_LINUX
#elif NACL_LINUX || NACL_FREEBSD
# define HIDDEN(n) .hidden IDENTIFIER(n)
#elif NACL_WINDOWS
/* On Windows, symbols are hidden by default. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#if NACL_WINDOWS
# define DLLEXPORT __declspec(dllexport)
#elif NACL_LINUX || NACL_OSX
#elif NACL_LINUX || NACL_FREEBSD || NACL_OSX
# define DLLEXPORT __attribute__ ((visibility("default")))
#elif defined(__native_client__)
/* do nothing */
Expand Down
4 changes: 2 additions & 2 deletions libs/nacl/native_client/src/include/nacl_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "native_client/src/include/elf.h"

#if NACL_LINUX || NACL_OSX
#if NACL_LINUX || NACL_FREEBSD || NACL_OSX
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>
Expand All @@ -26,7 +26,7 @@
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
#elif NACL_LINUX
#elif NACL_LINUX || NACL_FREEBSD
# include <sys/mman.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions libs/nacl/native_client/src/include/portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
# define NACL_PRIX64 NACL___PRI64_PREFIX "X"
#endif

#else /* NACL_LINUX, NACL_OSX, __native_client__ */
#else /* NACL_LINUX, NACL_FREEBSD, NACL_OSX, __native_client__ */

# ifndef __STDC_FORMAT_MACROS
# define __STDC_FORMAT_MACROS /* C++ */
Expand Down Expand Up @@ -251,7 +251,7 @@
# define NACL_PRIX8 "X"
# endif /* NACL_OSX */

#endif /* NACL_LINUX, NACL_OSX, __native_client__ */
#endif /* NACL_LINUX, NACL_FREEBSD, NACL_OSX, __native_client__ */

/*
* macros for run-time error detectors (such as Valgrind/Memcheck).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "native_client/src/shared/platform/nacl_check.h"


#if NACL_LINUX && defined(NACL_ENABLE_TMPFS_REDIRECT_VAR)
#if (NACL_LINUX || NACL_FREEBSD) && defined(NACL_ENABLE_TMPFS_REDIRECT_VAR)
static const char kNaClTempPrefixVar[] = "NACL_TMPFS_PREFIX";
#endif

Expand Down Expand Up @@ -172,7 +172,7 @@ NaClHandle NaClCreateMemoryObject(size_t length, int executable) {
* To handle this case, sel_ldr can take a path
* to tmpfs from the environment.
*/
#if NACL_LINUX && defined(NACL_ENABLE_TMPFS_REDIRECT_VAR)
#if (NACL_LINUX || NACL_FREEBSD) && defined(NACL_ENABLE_TMPFS_REDIRECT_VAR)
if (NACL_ENABLE_TMPFS_REDIRECT_VAR) {
const char* prefix = getenv(kNaClTempPrefixVar);
if (prefix != NULL) {
Expand Down

0 comments on commit 4cedce5

Please sign in to comment.