Skip to content

Remove definitions of NAME_MAX #716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2024
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
9 changes: 7 additions & 2 deletions src/provider/provider_os_memory_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
#ifndef UMF_OS_MEMORY_PROVIDER_INTERNAL_H
#define UMF_OS_MEMORY_PROVIDER_INTERNAL_H

#include <limits.h>

#if defined(_WIN32) && !defined(NAME_MAX)
#include <stdlib.h>
#define NAME_MAX _MAX_FNAME
#endif /* defined(_WIN32) && !defined(NAME_MAX) */

#include <umf/providers/provider_os_memory.h>

#include "critnib.h"
Expand All @@ -24,8 +31,6 @@ typedef enum umf_purge_advise_t {
UMF_PURGE_FORCE,
} umf_purge_advise_t;

#define NAME_MAX 255

typedef struct os_memory_provider_t {
unsigned protection; // combination of OS-specific protection flags
unsigned visibility; // memory visibility mode
Expand Down
3 changes: 1 addition & 2 deletions src/proxy_lib/proxy_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#endif

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

#include <umf/memory_pool.h>
Expand Down Expand Up @@ -113,7 +114,6 @@ void proxy_lib_create_common(void) {
umf_result_t umf_result;

#ifndef _WIN32
#define NAME_MAX 255
char shm_name[NAME_MAX];

if (util_env_var_has_str("UMF_PROXY", "page.disposition=shared-fd")) {
Expand All @@ -136,7 +136,6 @@ void proxy_lib_create_common(void) {
"named shared memory: %s",
os_params.shm_name);
}
#undef NAME_MAX
#endif

umf_result = umfMemoryProviderCreate(umfOsMemoryProviderOps(), &os_params,
Expand Down
Loading