dotdotpan / exceptions4c

Automatically exported from code.google.com/p/exceptions4c
0 stars 0 forks source link

Unit tests fail to compile - e4c_rsc.h error in e4c_dispose_mutex macro #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use default 
https://exceptions4c.googlecode.com/files/exceptions4c-3.0.0-test.zip
2. Compile using make
3. Compile fails with

What is the expected output? What do you see instead?

Expected clean compile. Instead got:
gcc -c e4c_rsc.c -o e4c_rsc.o -Wall -Wextra -ansi -pedantic -DE4C_NOKEYWORDS
In file included from e4c_rsc.c:31:0:
e4c_rsc.h:80:45: error: '#' is not followed by a macro parameter
make: *** [e4c_rsc.o] Error 1

What version of the product are you using? On what operating system?

Test code as per link in step 1, on Ubuntu 12.04 (also on 14.04).

Please provide any additional information below.

It appears the e4c_rsc.h doesn't match that in svn at 
https://code.google.com/p/exceptions4c/source/browse/trunk/etc/e4c_rsc.h. The 
macro names the parameters _mutex_ and _failed_, but uses mutex in the macro 
body leading to the error. Fix is:

--- e4c_rsc.h.orig  2014-05-02 14:21:32.137253057 +0100
+++ e4c_rsc.h   2014-05-02 14:21:07.113253730 +0100
@@ -79,7 +79,7 @@
  */
 # define e4c_dispose_mutex(_mutex_, _failed_) \
     if( pthread_mutex_unlock(_mutex_) != 0 ) \
-        throw(MutexUnlockError, "Could not unlock mutex: " #mutex)
+        throw(MutexUnlockError, "Could not unlock mutex: " #_mutex_)

 /**

Original issue reported on code.google.com by the.wron...@gmail.com on 2 May 2014 at 1:24