Navigation Menu

Skip to content

Commit

Permalink
OSX -> macOS
Browse files Browse the repository at this point in the history
Changing the filenames of the releases will be a bit more annoying, so
not sure we want to do that
  • Loading branch information
def- committed Feb 12, 2021
1 parent 2a87814 commit e985632
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Expand Up @@ -535,8 +535,8 @@ elseif(TARGET_OS STREQUAL "mac")
find_library(OPENGL OpenGL)
find_library(SECURITY Security)
set(PLATFORM_CLIENT
src/osx/notifications.mm
src/osxlaunch/client.m
src/macos/notifications.mm
src/macoslaunch/client.m
)
set(PLATFORM_CLIENT_LIBS ${COCOA} ${OPENGL})
set(PLATFORM_LIBS ${CARBON} ${SECURITY})
Expand Down Expand Up @@ -2073,7 +2073,7 @@ list(APPEND TARGETS_OWN ${TARGET_SERVER})
list(APPEND TARGETS_LINK ${TARGET_SERVER})

if(TARGET_OS AND TARGET_OS STREQUAL "mac")
set(SERVER_LAUNCHER_SRC src/osxlaunch/server.mm)
set(SERVER_LAUNCHER_SRC src/macoslaunch/server.mm)
set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher)
add_executable(${TARGET_SERVER_LAUNCHER} ${SERVER_LAUNCHER_SRC})
target_link_libraries(${TARGET_SERVER_LAUNCHER} ${COCOA})
Expand Down
4 changes: 2 additions & 2 deletions src/base/detect.h
Expand Up @@ -63,8 +63,8 @@
#if defined(MACOSX) || defined(__APPLE__) || defined(__DARWIN__)
#define CONF_FAMILY_UNIX 1
#define CONF_FAMILY_STRING "unix"
#define CONF_PLATFORM_MACOSX 1
#define PLATFORM_STRING "macosx"
#define CONF_PLATFORM_MACOS 1
#define PLATFORM_STRING "macos"
#endif

#if defined(__sun)
Expand Down
12 changes: 6 additions & 6 deletions src/base/system.c
Expand Up @@ -35,7 +35,7 @@

#include <dirent.h>

#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
// some lock and pthread functions are already defined in headers
// included from Carbon.h
// this prevents having duplicate definitions of those
Expand Down Expand Up @@ -882,7 +882,7 @@ void sphore_init(SEMAPHORE *sem)
void sphore_wait(SEMAPHORE *sem) { WaitForSingleObject((HANDLE)*sem, INFINITE); }
void sphore_signal(SEMAPHORE *sem) { ReleaseSemaphore((HANDLE)*sem, 1, NULL); }
void sphore_destroy(SEMAPHORE *sem) { CloseHandle((HANDLE)*sem); }
#elif defined(CONF_PLATFORM_MACOSX)
#elif defined(CONF_PLATFORM_MACOS)
void sphore_init(SEMAPHORE *sem)
{
char aBuf[64];
Expand Down Expand Up @@ -935,7 +935,7 @@ int64 time_get_impl(void)
{
static int64 last = 0;
{
#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
static int got_timebase = 0;
mach_timebase_info_data_t timebase;
uint64 time;
Expand Down Expand Up @@ -986,7 +986,7 @@ int64 time_get(void)

int64 time_freq(void)
{
#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
return 1000000000;
#elif defined(CONF_FAMILY_UNIX)
return 1000000;
Expand Down Expand Up @@ -2061,13 +2061,13 @@ int fs_storage_path(const char *appname, char *path, int max)
return 0;
#else
char *home = getenv("HOME");
#if !defined(CONF_PLATFORM_MACOSX)
#if !defined(CONF_PLATFORM_MACOS)
int i;
#endif
if(!home)
return -1;

#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
snprintf(path, max, "%s/Library/Application Support/%s", home, appname);
#else
snprintf(path, max, "%s/.%s", home, appname);
Expand Down
4 changes: 2 additions & 2 deletions src/base/system.h
Expand Up @@ -611,7 +611,7 @@ void lock_unlock(LOCK lock) RELEASE(lock);
/* Group: Semaphores */
#if defined(CONF_FAMILY_WINDOWS)
typedef void *SEMAPHORE;
#elif defined(CONF_PLATFORM_MACOSX)
#elif defined(CONF_PLATFORM_MACOS)
#include <semaphore.h>
typedef sem_t *SEMAPHORE;
#elif defined(CONF_FAMILY_UNIX)
Expand Down Expand Up @@ -1655,7 +1655,7 @@ int fs_makedir_rec_for(const char *path);
Remarks:
- Returns ~/.appname on UNIX based systems
- Returns ~/Library/Applications Support/appname on Mac OS X
- Returns ~/Library/Applications Support/appname on macOS
- Returns %APPDATA%/Appname on Windows based systems
*/
int fs_storage_path(const char *appname, char *path, int max);
Expand Down
6 changes: 3 additions & 3 deletions src/engine/client/backend_sdl.cpp
Expand Up @@ -74,7 +74,7 @@ void CGraphicsBackend_Threaded::ThreadFunc(void *pUser)
pThis->m_Activity.Wait();
if(pThis->m_pBuffer)
{
#ifdef CONF_PLATFORM_MACOSX
#ifdef CONF_PLATFORM_MACOS
CAutoreleasePool AutoreleasePool;
#endif
pThis->m_pProcessor->RunBuffer(pThis->m_pBuffer);
Expand Down Expand Up @@ -4757,7 +4757,7 @@ void CGraphicsBackend_SDL_OpenGL::Maximize()

bool CGraphicsBackend_SDL_OpenGL::Fullscreen(bool State)
{
#if defined(CONF_PLATFORM_MACOSX) // Todo SDL: remove this when fixed (game freezes when losing focus in fullscreen)
#if defined(CONF_PLATFORM_MACOS) // Todo SDL: remove this when fixed (game freezes when losing focus in fullscreen)
return SDL_SetWindowFullscreen(m_pWindow, State ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0) == 0;
#else
return SDL_SetWindowFullscreen(m_pWindow, State ? SDL_WINDOW_FULLSCREEN : 0) == 0;
Expand Down Expand Up @@ -4836,7 +4836,7 @@ void CGraphicsBackend_SDL_OpenGL::NotifyWindow()
desc.dwTimeout = 0;

FlashWindowEx(&desc);
#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOSX)
#elif defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_PLATFORM_MACOS)
Display *dpy = info.info.x11.display;
Window win = info.info.x11.window;

Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/backend_sdl.h
Expand Up @@ -11,7 +11,7 @@

#include <atomic>

#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
#include <objc/objc-runtime.h>

class CAutoreleasePool
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/client.cpp
Expand Up @@ -4255,7 +4255,7 @@ void CClient::HandleMapPath(const char *pPath)
Upstream latency
*/

#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
extern "C" int TWMain(int argc, const char **argv) // ignore_convention
#else
int main(int argc, const char **argv) // ignore_convention
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/input.cpp
Expand Up @@ -347,7 +347,7 @@ int CInput::Update()
m_InputGrabbed = true;
}
break;
#if defined(CONF_PLATFORM_MACOSX) // Todo: remove this when fixed in SDL
#if defined(CONF_PLATFORM_MACOS) // Todo: remove this when fixed in SDL
case SDL_WINDOWEVENT_MAXIMIZED:
MouseModeAbsolute();
MouseModeRelative();
Expand Down
4 changes: 2 additions & 2 deletions src/engine/client/notifications.cpp
Expand Up @@ -2,8 +2,8 @@

#include <base/detect.h>

#if defined(CONF_PLATFORM_MACOSX)
// Code is in src/osx/notification.mm.
#if defined(CONF_PLATFORM_MACOS)
// Code is in src/macos/notification.mm.
#elif defined(CONF_FAMILY_UNIX)
#include <libnotify/notify.h>
void NotificationsInit()
Expand Down
4 changes: 2 additions & 2 deletions src/engine/client/video.cpp
Expand Up @@ -215,7 +215,7 @@ void CVideo::NextVideoFrameThread()
{
if(m_NextFrame && m_Recording)
{
// #ifdef CONF_PLATFORM_MACOSX
// #ifdef CONF_PLATFORM_MACOS
// CAutoreleasePool AutoreleasePool;
// #endif
m_Vseq += 1;
Expand Down Expand Up @@ -243,7 +243,7 @@ void CVideo::NextVideoFrame()
{
if(m_Recording)
{
// #ifdef CONF_PLATFORM_MACOSX
// #ifdef CONF_PLATFORM_MACOS
// CAutoreleasePool AutoreleasePool;
// #endif

Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/video.h
Expand Up @@ -10,7 +10,7 @@
#else
#include "SDL_opengl.h"

#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
#include "OpenGL/glu.h"
#else
#include "GL/glu.h"
Expand Down
4 changes: 2 additions & 2 deletions src/engine/shared/config_variables.h
Expand Up @@ -98,7 +98,7 @@ MACRO_CONFIG_INT(SndHighlight, snd_highlight, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CL
MACRO_CONFIG_INT(GfxScreen, gfx_screen, 0, 0, 15, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen index")
MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 0, 0, 0, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen resolution width")
MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 0, 0, 0, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Screen resolution height")
#if !defined(CONF_PLATFORM_MACOSX)
#if !defined(CONF_PLATFORM_MACOS)
MACRO_CONFIG_INT(GfxBorderless, gfx_borderless, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Borderless window (not to be used with fullscreen)")
MACRO_CONFIG_INT(GfxFullscreen, gfx_fullscreen, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Fullscreen")
#else
Expand Down Expand Up @@ -395,7 +395,7 @@ MACRO_CONFIG_INT(GfxOpenGLTextureLODBIAS, gfx_opengl_texture_lod_bias, -500, -15

MACRO_CONFIG_INT(Gfx3DTextureAnalysisDone, gfx_3d_texture_analysis_done, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Analyzed, if sampling 3D/2D array textures was correct")
MACRO_CONFIG_INT(GfxDriverIsBlocked, gfx_driver_is_blocked, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "If 1, the current driver is in a blocked error state.")
#if !defined(CONF_PLATFORM_MACOSX)
#if !defined(CONF_PLATFORM_MACOS)
MACRO_CONFIG_INT(GfxEnableTextureUnitOptimization, gfx_enable_texture_unit_optimization, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use multiple texture units, instead of only one.")
#else
MACRO_CONFIG_INT(GfxEnableTextureUnitOptimization, gfx_enable_texture_unit_optimization, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use multiple texture units, instead of only one.")
Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared/storage.cpp
Expand Up @@ -269,7 +269,7 @@ class CStorage : public IStorage
}
else
{
#if defined(CONF_PLATFORM_MACOSX)
#if defined(CONF_PLATFORM_MACOS)
str_append(m_aBinarydir, "/../../../DDNet-Server.app/Contents/MacOS", sizeof(m_aBinarydir));
str_format(aBuf, sizeof(aBuf), "%s/" PLAT_SERVER_EXEC, m_aBinarydir);
IOHANDLE File = io_open(aBuf, IOFLAG_READ);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion storage.cfg
Expand Up @@ -7,7 +7,7 @@
# There are 3 special paths available:
# $USERDIR
# - ~/.appname on UNIX based systems
# - ~/Library/Applications Support/appname on Mac OS X
# - ~/Library/Applications Support/appname on macOS
# - %APPDATA%/Appname on Windows based systems
# $DATADIR
# - the 'data' directory which is part of an official
Expand Down

0 comments on commit e985632

Please sign in to comment.