Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON) # gnu11: hace falta para POSIX/BSD (termios, ioctl)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# No funciona solo con CMAKE_C_EXTENSIONS, hay que definirlo explicitamente, aunque CMAKE_EXTENSIONS
# expone símbolos clave de libc y glibc, para que funcione en Linux hay que añadir la macro
# POSIX del compilador. Se debe definir antes que cualquier otro archivo o cabecera
add_compile_definitions(_XOPEN_SOURCE=700) # Usamos la versión 2008 POSIX
add_compile_definitions(_DEFAULT_SOURCE)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE)
endif()
Expand Down
3 changes: 0 additions & 3 deletions src/pty.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* Dueño: LevtCode. Portable: usar posix_openpt, no openpty (evita #ifdef). */

/* Macro del compilador para poder usar posix_openpt. (Debe declararse casi al principio del código) */
#define _XOPEN_SOURCE 600

#include "omicron/pty.h"
#include "omicron/sandbox.h"

Expand Down
8 changes: 8 additions & 0 deletions src/sandbox_darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ om_sandbox *om_sandbox_prepare(const om_policy *p)
return NULL;
}

/* Ojo al implementar: sandbox_init() está marcada deprecada desde macOS 10.8 y
* con -Werror el build falla por -Wdeprecated-declarations. Sigue siendo la API
* viva de Seatbelt, así que NO apagar OMICRON_WERROR: envolver solo la llamada.
* #pragma clang diagnostic push
* #pragma clang diagnostic ignored "-Wdeprecated-declarations"
* rc = sandbox_init(s->profile, 0, &err);
* #pragma clang diagnostic pop
*/
int om_sandbox_apply(const om_sandbox *s)
{
(void)s;
Expand Down
Loading