Commit Graph

309 Commits

Author SHA1 Message Date
Michael Davidsaver
9edb9c2050 WIN32: epicsFindSymbol() fix use of EnumProcessModules() 2020-04-18 08:18:03 -07:00
Michael Davidsaver
aa7c2a647c fix epicsLoadError()
FORMAT_MESSAGE_IGNORE_INSERTS as no va_list is provided.

Handle possibility of n=0 if unable to lookup error.
2020-04-18 07:35:21 -07:00
Michael Davidsaver
6e41f2911b WIN32: GetLastError() returns DWORD 2020-04-18 07:33:57 -07:00
Michael Davidsaver
db2cd68ce3 WIN32: osdFindSymbol() use psapi 2020-04-16 07:53:06 -07:00
Michael Davidsaver
1492baace9 WIN32: epicsLoadError() strip trailing newlines 2020-04-16 07:45:40 -07:00
Andrew Johnson
85d1982890 Merge changes from 3.15 branch into 7.0 2020-04-15 21:39:54 -05:00
Michael Davidsaver
6f44f64afb add epicsLoadTest 2020-03-24 08:38:41 -07:00
Michael Davidsaver
24df056bcb WIN32 fix epicsFindSymbol()
Passing zero as to GetProcAddress is undocumented,
but seems to be equivalent to passing GetModuleHandle(NULL)
which searches only the address space of the executable file.

Emulate the effect of dlsym(0, ...) by searching all
loaded modules.  Probably not so efficient...
2020-03-24 08:38:36 -07:00
Michael Davidsaver
d3b2298bcb WIN32 fix epicsFindSymbol() error propagation
And use thread local to hold error code/message.
2020-03-24 08:38:33 -07:00
Michael Davidsaver
872009336e OSX fix osdFindSymbol
RTLD_DEFAULT isn't zero on OSX
2020-03-24 08:38:29 -07:00
Michael Davidsaver
46fa31020e Com: (WIN32) fix handling of thread joinable flag and refcnt
Analogous changes for windows

cf. 02a24a144d
2020-03-23 09:57:14 -07:00
Andrew Johnson
5009f288ae Generate module version files with new RULES_EXPAND facilities
Also removes the separate *VersionNum.h@ templates
2020-03-20 12:03:14 -05:00
Andrew Johnson
0f35d0c3f9 Improve epicsEventTest delay checks 2020-03-12 13:59:41 -05:00
Andrew Johnson
b4625a0c1f Fix osiSockTest on VxWorks 2020-03-12 13:49:55 -05:00
Michael Davidsaver
02a24a144d Com: fix handling of thread joinable flag and refcnt
The second increment of refcnt must occur before pthread_create
or a subtle possibility of a double free() occurs if the thread
runs immediately and self-joins before the second inc.

Also use atomic ops for joinable flag to ensure that
concurrent joins will error properly.
2020-03-08 22:27:06 -07:00
Andrew Johnson
0cf38bfb29 Try out a representative sample of APIs from multiple libraries 2020-03-07 01:32:36 -06:00
Andrew Johnson
227a749105 Properly convert epicsTempFile to old-style C 2020-03-04 21:49:17 -06:00
Andrew Johnson
fdacb6b92e MSVC <= 11.0 doesn't like 'const int' in C code 2020-03-03 00:53:16 -06:00
Andrew Johnson
5361888997 Have antelope.c include epicsTempFile.c directly 2020-02-29 14:46:13 -06:00
Andrew Johnson
cc4d888ae8 Convert epicsTempFile.cpp to .c 2020-02-29 14:42:54 -06:00
Michael Davidsaver
8668cc1267 testTodoEnd() needs to lock
when NULLing
2020-02-14 13:28:44 +00:00
Michael Davidsaver
bf533ac195 win32 epicsSocketEnableAddressUseForDatagramFanout call spec
apparently epicsShareAPI is required on both declaration and definition.
2020-02-14 09:00:49 +00:00
Michael Davidsaver
819b0de65b epicsTimerTest testImpreciseTiming() 2020-02-14 09:00:17 +00:00
Karl Vestin
8075b3c316 Added a null check in epicsWin32ThreadEntry to prevent dereferencing a null pointer in case fetchWin32ThreadGlobal fails.
LP: #1863118
2020-02-13 16:16:56 +00:00
Gabriel Fedel
6feb1c788d Add extern C for all c headers
This allow that these files could be imported to c++ correctly
2020-02-13 14:21:54 +00:00
Aaron
6e0706a312 Set argBuff->sval to NULL if arg is NULL 2020-02-13 13:22:26 +00:00
Aaron
45bbe274e9 Error case for NULL arg causing segfault in iocshPersistentString 2020-02-13 13:22:19 +00:00
Michael Davidsaver
db6e7c7a22 use one osdSockAddrReuse impl for all targets
drop win32 specialization of osdSockAddrReuse
2020-02-12 10:52:51 +00:00
Michael Davidsaver
5064931aa6 try both to set both SO_REUSEPORT and SO_REUSEADDR
It seems that on Linux, SO_REUSEPORT shares with SO_REUSEPORT
and SO_REUSEADDR with SO_REUSEADDR, but not each other.

Setting both allows full sharing
2020-02-12 10:52:15 +00:00
Michael Davidsaver
d0c4cc0cec Darwin/iOS use posix osdSockAddrReuse.cpp
Redundant now that the posix version prefers SO_REUSEPORT
if defined.
2020-01-12 11:49:48 -08:00
Michael Davidsaver
65ef6e9d59 posix epicsSocketEnableAddressUseForDatagramFanout() prefer SO_REUSEPORT
prefer SO_REUSEPORT on targets which define it.

Linux defines both, and seems to treat
SO_REUSEPORT and SO_REUSEADDR as equivalent.
BSD derivatives need SO_REUSEPORT.
2020-01-12 11:49:26 -08:00
Michael Davidsaver
8dc131dc4c osiSockTest test epicsSocketEnableAddressUseForDatagramFanout() 2020-01-12 11:48:20 -08:00
Andrew Johnson
8f358f4dd8 VxWorks::osdThread: Rename createFunction => epicsThreadEntry
and make it visible (non-static) so it appears in back-traces.
2020-01-02 16:41:55 -06:00
Andrew Johnson
05e0381b19 Fix VxWorks epicsThreadMustJoin() problems
taskWait() actually returns OK on timeout, so drop the timeout warning
(the other implementations don't have one).
The taskWait() may return ERROR with S_objLib_OBJ_ID_ERROR if the target
thread has higher priority; this indicates a successful join, because
we already did a rendezvous using joinSem.
Delete joinSem *after* calling taskSpareFieldSet(), in case it matters.
2020-01-02 16:39:10 -06:00
Andrew Johnson
06728e0e0b Run epicsThreadTest::testJoining with different priorities
A problem in the VxWorks epicsThreadMustJoin() only occurs when
the joining thread runs at a higher priority than its supervisor.
2020-01-02 16:22:35 -06:00
Andrew Johnson
e7715ba7b4 Merge 3.15 branch into 7.0 2019-12-18 23:58:02 -06:00
Michael Davidsaver
189060c14f Merge branch '3.15' into 7.0
* 3.15:
  minor epicsTimerTest
  epicsTimerTest loosen test threshold
  debug epicsTimerTest
  posix/epicsMath.h
  Revert "libcom: fix colliding isnan/isinf between C99 and C++0x for gcc-4"
  Revert "libcom: properly declare isnan() in C++ code"
  travis-ci /etc/hosts workaround
  redo travis-ci with matrix
  epicsSockResolveTest add detail
  libcom: properly declare isnan() in C++ code
  libcom: fix colliding isnan/isinf between C99 and C++0x for gcc-4
  libcom: import some C99 math (isnan etc.) into global namespace

# Conflicts:
#	.travis.yml
#	ci/travis-prepare.sh
2019-12-16 15:39:48 -08:00
Michael Davidsaver
90ef40e62b iocshFindVariable() safety 2019-11-24 19:39:44 -08:00
Martin Konrad
218459f454 Remove epicsThrows() macro
Exception specifications are deprecated: http://isocpp.github.io/
CppCoreGuidelines/CppCoreGuidelines.html#e30-dont-use-exception-
specifications . They will be removed from the C++ standard with
C++20. Modern compilers are warning about them since years. Thus
it's unlikely that anyone is still using the epicsThrows() macro.
Even if that's the case the fix is trivial: Simply remove the macro.
2019-11-15 21:15:50 -08:00
Martin Konrad
13234afc40 Simplify definition of compiler-specific macros
Remove conditionals for older compiler versions that aren't
supported by EPICS Base anymore.
2019-11-15 21:14:27 -08:00
Andrew Johnson
f3d63da77b Remove two long-unused environment parameters 2019-11-15 13:16:35 -06:00
Michael Davidsaver
b43aafae70 VCS version instead of __DATE__
Use reproducable VCS version instead of date.
Of course, this falls back to a date if not
version controlled.
2019-11-13 10:18:12 -08:00
Michael Davidsaver
905ca4b7ac quiet some warnings 2019-11-13 10:17:43 -08:00
Michael Davidsaver
7acd7c6145 minor epicsTimerTest 2019-11-12 19:07:30 -08:00
Michael Davidsaver
bef9a08f6d asLib minor 2019-11-12 19:07:30 -08:00
Michael Davidsaver
3e7ad9a86f rtems_init cleanup
Remove unnecessary (as of RTEMS 4.9) prototypes
Remove unused *Fatal
constify string contant
2019-11-12 19:07:30 -08:00
Michael Davidsaver
76b9461ee8 logClient windows needs SOCK_E* 2019-11-12 19:07:30 -08:00
Andrew Johnson
220a27bdec Merge Dirk's dynamicVxWorksVmeFunctionBinding branch into 7.0 2019-10-28 15:11:54 -05:00
Andrew Johnson
171b3301a7 Fix ..// => ../ in Makefile-relative source paths 2019-10-28 15:00:15 -05:00
Andrew Johnson
e178fa85b6 Merge 7.0 back into 7.0
Insert tab B back into slot A ...
2019-10-28 13:30:58 -05:00