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
5 changes: 4 additions & 1 deletion _include/P2WMutex.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef _P2WMUTEX_HPP
#define _P2WMUTEX_HPP

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
Expand Down Expand Up @@ -280,3 +282,4 @@ class P2WCond
};
static_assert(sizeof(pthread_cond_t) == sizeof(P2WCond), "Size is not correct");
#endif
#endif // ifndef _P2WMUTEX_HPP
5 changes: 4 additions & 1 deletion _include/P2WSem.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef _P2WSEM_HPP
#define _P2WSEM_HPP

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
Expand Down Expand Up @@ -70,3 +72,4 @@ class P2WSem
}
};
static_assert(sizeof(sem_t) == sizeof(P2WSem), "Size is not correct");
#endif // ifndef _P2WSEM_HPP
5 changes: 4 additions & 1 deletion _include/P2WThread.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef _P2WTHREAD_HPP
#define _P2WTHREAD_HPP

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
Expand Down Expand Up @@ -348,3 +350,4 @@ class P2WThread
}
#endif // PTHREAD
};
#endif // ifndef _P2WTHREAD_HPP
6 changes: 4 additions & 2 deletions _include/_mdsshr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef __MDSSHR_H
#define __MDSSHR_H
#include <mdsshr.h>
#include <status.h>
#include <mdsmsg.h>
Expand All @@ -19,4 +20,5 @@ struct sockaddr;
static returns(*method) args = NULL; \
MDSSHR_LOAD_LIBROUTINE(method, lib, method, on_error)

extern int _LibGetHostAddr(const char *hostname, const char *service, struct sockaddr *sin);
extern int _LibGetHostAddr(const char *hostname, const char *service, struct sockaddr *sin);
#endif // ifndef __MDSSHR_H
4 changes: 3 additions & 1 deletion _include/int128.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _INT128_H
#define _INT128_H
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
Expand Down Expand Up @@ -379,3 +380,4 @@ static inline int int128_div(const int128_t *x, const int128_t *d,
int128_minus(ans, ans);
return 1;
}
#endif // ifndef _INT128_H
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,8 @@ dnl Here we define all custom autoheader adds to mdsconfig.h.in

dnl add here what goes on tom of mdsconfig.h
AH_TOP(
#pragma once
#ifndef _MDSCONFIG_H
#define _MDSCONFIG_H
#ifdef _MSC_VER
#define __attribute__(...)
#define EXPORT __declspec(dllexport)
Expand Down Expand Up @@ -1248,6 +1249,7 @@ AH_VERBATIM([_WIN32], [
dnl add here what goes on bottom of mdsconfig.h
AH_BOTTOM(
#endif // _MSC_VER else
#endif // ifndef _MDSCONFIG_H
)


Expand Down
7 changes: 5 additions & 2 deletions deploy/gen_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class %(fac)s%(msgnam)s(%(fac)sException):%(depr)s
"""

inc_head = """
#pragma once
#ifndef _{base}_{ext}
#define _{base}_{ext}
#include <status.h>

"""
Expand Down Expand Up @@ -296,7 +297,8 @@ def gen_include(root, filename, faclist, msglistm, f_test):
print(filename)
with open("%s/include/%sh" % (sourcedir, filename[0:-3]), 'w') as f_inc:
add_c_header(f_inc, filename)
f_inc.write(inc_head)
parts = filename.upper().split('.')
f_inc.write(inc_head.format(base=parts[0],ext=parts[1]))
for f in root.iter('facility'):
facnam = f.get('name')
facnum = int(f.get('value'))
Expand Down Expand Up @@ -352,6 +354,7 @@ def gen_include(root, filename, faclist, msglistm, f_test):
if not facnam in pfaclist:
pfaclist.append(facnam)
msglist.append(msg)
f_inc.write("#endif")


# gen_msglist():
Expand Down
4 changes: 3 additions & 1 deletion include/Xmds/XmdsWaveform.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
Management.
----------------------------------------------------------------------------*/

#pragma once
#ifndef _XMDSWAVEFORM_H
#define _XMDSWAVEFORM_H
#include <stdio.h>
#ifndef _Xm_h
#include <Xm/Xm.h>
Expand Down Expand Up @@ -210,3 +211,4 @@ extern void XmdsWaveformUpdate(Widget w, XmdsWaveformValStruct *x,
extern void XmdsWaveformSetWave(Widget w, int count, float *x, float *y,
Boolean *select, Boolean *pendown,
Boolean autoscale, Boolean defer_update);
#endif //ifndef _XMDSWAVEFORM_H
4 changes: 3 additions & 1 deletion include/camshr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _CAMSHR_H
#define _CAMSHR_H

extern int CamBytcnt(unsigned short *iosb);
extern int CamError(int *xexp, int *qexp, unsigned short *iosb_in);
Expand Down Expand Up @@ -35,3 +36,4 @@ typedef struct
} CamKey;

extern int CamXlateLogicalname(char *Name, CamKey *key);
#endif
4 changes: 3 additions & 1 deletion include/dbidef.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _DBIDEF_H
#define _DBIDEF_H
/* VAX/DEC CMS REPLACEMENT HISTORY, Element DBIDEF.H */
/* *3 1-APR-1991 17:29:45 TWF "Add readonly open" */
/* *2 16-FEB-1990 10:28:18 TWF "Add itmlst struct" */
Expand Down Expand Up @@ -33,3 +34,4 @@ typedef struct dbi_itm
void *pointer;
int *return_length_address;
} DBI_ITM;
#endif
4 changes: 3 additions & 1 deletion include/dcl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _DCL_H
#define _DCL_H

#include <mdsdescrip.h>
extern int mdsdclAddCommands(const char *name_in, char **error);
Expand All @@ -20,3 +21,4 @@ extern int mdsdcl_do_command_extra_args(char const *command, char **prompt,
char *(*getline)(), void *getlineinfo);
extern int cli_get_value(void *ctx, const char *name, char **value);
extern int cli_present(void *ctx, const char *name);
#endif
5 changes: 3 additions & 2 deletions include/mdsshr.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#ifndef _MDSSHR_H
#define _MDSSHR_H
#define MdsCOMPRESSIBLE 3
#include <mdsdescrip.h>
#include <mdstypes.h>
Expand Down Expand Up @@ -159,3 +159,4 @@ extern "C"
#ifdef __cplusplus
}
#endif
#endif
4 changes: 3 additions & 1 deletion include/ncidef.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _NCIDEF_H
#define _NCIDEF_H
/**************************************
NCIDEF.H - definitions of constants
used in item list arguments to the
Expand Down Expand Up @@ -93,3 +94,4 @@ typedef struct nci_itm
void *pointer;
int *return_length_address;
} NCI_ITM;
#endif
4 changes: 3 additions & 1 deletion include/status.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _STATUS_H
#define _STATUS_H
#include <mdsshr_messages.h>
#define STATUS_H(x) x
#define FALSE 0
Expand Down Expand Up @@ -34,3 +35,4 @@
#define GOTO_IF_NOT_OK(MARK, CHECK) \
if (IS_NOT_OK((status = (CHECK)))) \
goto MARK;
#endif
4 changes: 3 additions & 1 deletion include/strroutines.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _STRROUTINES_H
#define _STRROUTINES_H

#include <mdsdescrip.h>

Expand Down Expand Up @@ -51,3 +52,4 @@ static void __attribute__((unused)) free_d(void *ptr)
#define INIT_AND_FREED_ON_EXIT(var, dtype) \
INIT_AS_AND_FREED_ON_EXIT(var, ((mdsdsc_d_t){0, dtype, CLASS_D, NULL}))
#endif
#endif
4 changes: 3 additions & 1 deletion include/tdishr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _TDISHR_H
#define _TDISHR_H
#include <mdsdescrip.h>
#include <mdstypes.h>
#include <status.h>
Expand Down Expand Up @@ -31,3 +32,4 @@ extern int _TdiIntrinsic(void **ctx, opcode_t opcode, int narg,
struct descriptor_xd *out_ptr);
extern int CvtConvertFloat(void *invalue, uint32_t indtype, void *outvalue,
uint32_t outdtype, uint32_t options);
#endif
4 changes: 3 additions & 1 deletion include/treeshr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _TREESHR_H
#define _TREESHR_H

/********** define this in case user code is checking it ************/

Expand Down Expand Up @@ -378,3 +379,4 @@ extern "C"
#ifdef __cplusplus
}
#endif
#endif
4 changes: 3 additions & 1 deletion include/usagedef.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _USAGEDEF_H
#define _USAGEDEF_H
/* USAGEDEF.H ************************************

Node Usage definitions
Expand Down Expand Up @@ -28,3 +29,4 @@ TYPEDEF(1){TreeUSAGE_ANY = 0, TreeUSAGE_STRUCTURE = 1, TreeUSAGE_ACTION = 2,
#undef TYPEDEF
#undef ENDDEF
#define TreeUSAGE_NONE TreeUSAGE_STRUCTURE
#endif
4 changes: 3 additions & 1 deletion include/xmdsshr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _XMDSSHR_H
#define _XMDSSHR_H
#include <Mrm/MrmPublic.h>
#include <X11/Intrinsic.h>
#include <Xmds/ListTreeP.h>
Expand Down Expand Up @@ -74,3 +75,4 @@ extern EXPORT Pixmap *XmdsUsageGrayIcons();

extern EXPORT WidgetClass xmdsWaveformWidgetClass;
extern EXPORT XmdsWaveformClassRec xmdsWaveformClassRec;
#endif
4 changes: 3 additions & 1 deletion mdsdcl/mdsdclthreadstatic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _MDSDCLTHREADSTATIC_H
#define _MDSDCLTHREADSTATIC_H
#include "../mdsshr/mdsthreadstatic.h"
#include "dcl_p.h"

Expand All @@ -18,3 +19,4 @@ typedef struct
#define DCL_DOCS DCLTHREADSTATIC_VAR->docs

extern DEFINE_GETTHREADSTATIC(DCLTHREADSTATIC_TYPE, DclGetThreadStatic);
#endif // ifndef _MDSDCLTHREADSTATIC_H
4 changes: 3 additions & 1 deletion mdsshr/mdsshrp.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _MDSSHRP_H
#define _MDSSHRP_H

#include <mdsdescrip.h>

Expand All @@ -22,3 +23,4 @@ extern int MDSUdpEventAstMask(char const *eventName,
extern int MDSUdpEventCan(int eventid);
extern int MDSUdpEvent(char const *eventName, int bufLen, char const *buf);
extern int LibSFree1Dd(struct descriptor *out);
#endif //indef _MDSSHRP_H
4 changes: 3 additions & 1 deletion mdsshr/mdsthreadstatic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _MDSTHREADSTATIC_H
#define _MDSTHREADSTATIC_H
#include <mdsdescrip.h>
#include <mdstypes.h>
#include <pthread_port.h>
Expand Down Expand Up @@ -59,3 +60,4 @@ typedef struct
#define MDS_FIS_ERROR MDSTHREADSTATIC_VAR->librtl_fis_error

extern DEFINE_GETTHREADSTATIC(MDSTHREADSTATIC_TYPE, MdsGetThreadStatic);
#endif // ifndef _MDSTHREADSTATIC_H
4 changes: 3 additions & 1 deletion mdstcpip/mdsIo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#pragma once
#ifndef _MDSIO_H
#define _MDSIO_H
#ifndef DOXYGEN // hide this part from documentation

typedef enum
Expand Down Expand Up @@ -128,3 +129,4 @@ typedef union {
}
#endif
#endif // DOXYGEN end of hidden code
#endif // ifndef _MDSIO_H
4 changes: 3 additions & 1 deletion mdstcpip/mdsipshr/mdsipthreadstatic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _MDSIPTHREADSTATIC_H
#define _MDSIPTHREADSTATIC_H
#include "../mdsshr/mdsthreadstatic.h"
#include "../mdsip_connections.h"

Expand All @@ -16,3 +17,4 @@ typedef struct
#define MDSIP_CONNECTIONS MDSIPTHREADSTATIC_VAR->connections

extern DEFINE_GETTHREADSTATIC(MDSIPTHREADSTATIC_TYPE, MdsIpGetThreadStatic);
#endif // ifndef _MDSIPTHREADSTATIC_H
4 changes: 3 additions & 1 deletion servershr/Job.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _JOB_H
#define _JOB_H
#include <pthread_port.h>

#include <mdsmsg.h>
Expand Down Expand Up @@ -262,3 +263,4 @@ static void Job_cleanup(int status, int jobid)
j = Job_pop_by_conid(conid);
} while (j);
}
#endif // ifndef _JOB_H
5 changes: 4 additions & 1 deletion tdishr/tdithreadstatic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef _TDITHREADSTATIC_H
#define _TDITHREADSTATIC_H

#include "../mdsshr/mdsthreadstatic.h"
#include "tdirefzone.h"

Expand Down Expand Up @@ -72,3 +74,4 @@ typedef struct
#define TDI_BALANCE (TDI_STACK.balance.all)

extern DEFINE_GETTHREADSTATIC(TDITHREADSTATIC_TYPE, TdiGetThreadStatic);
#endif // ifndef _TDITHREADSTATIC_H
4 changes: 3 additions & 1 deletion testing/testing.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef _TESTING_H
#define _TESTING_H

#include <assert.h>
#include <string.h>
Expand Down Expand Up @@ -211,3 +212,4 @@ _Pragma("GCC diagnostic ignored \"-Wcatch-value\"")
TEST1(correct_exception_caught); \
}
#endif
#endif // ifndef _TESTING_H
5 changes: 4 additions & 1 deletion treeshr/treeshr_xnci.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

#pragma once
#ifndef _TREESHR_XNCI_H
#define _TREESHR_XNCI_H

#include <treeshr.h>
#ifdef __cplusplus
extern "C"
Expand Down Expand Up @@ -72,3 +74,4 @@ extern "C"
#ifdef __cplusplus
}
#endif
#endif // ifndef _TREESHR_XNCI_H
5 changes: 4 additions & 1 deletion treeshr/treethreadstatic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef _TREETHREADSTATIC_H
#define _TREETHREADSTATIC_H

#include "../mdsshr/mdsthreadstatic.h"
#include "treeshrp.h"

Expand Down Expand Up @@ -41,3 +43,4 @@ extern DEFINE_GETTHREADSTATIC(TREETHREADSTATIC_TYPE, TreeGetThreadStatic);

extern void **TreeCtx();
extern EXPORT int TreeUsePrivateCtx(int onoff);
#endif // ifndef _TREETHREADSTATIC_H