* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
- * This file contains 150 fixup descriptions.
+ * This file contains 151 fixup descriptions.
*
* See README for more information.
*
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Solaris_Mutex_Init fix
+ * Description of Solaris_Mutex_Init_1 fix
*/
-tSCC zSolaris_Mutex_InitName[] =
- "solaris_mutex_init";
+tSCC zSolaris_Mutex_Init_1Name[] =
+ "solaris_mutex_init_1";
/*
* File name selection pattern
*/
-tSCC zSolaris_Mutex_InitList[] =
+tSCC zSolaris_Mutex_Init_1List[] =
"|pthread.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzSolaris_Mutex_InitMachs (const char**)NULL
+#define apzSolaris_Mutex_Init_1Machs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zSolaris_Mutex_InitSelect0[] =
+tSCC zSolaris_Mutex_Init_1Select0[] =
+ "@\\(#\\)pthread.h[ \t]+1.1[0-9][ \t]+9[567]/[0-9/]+ SMI";
+
+#define SOLARIS_MUTEX_INIT_1_TEST_CT 1
+static tTestDesc aSolaris_Mutex_Init_1Tests[] = {
+ { TT_EGREP, zSolaris_Mutex_Init_1Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Mutex_Init_1
+ */
+static const char* apzSolaris_Mutex_Init_1Patch[] = { "sed",
+ "-e", "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n\
+/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Solaris_Mutex_Init_2 fix
+ */
+tSCC zSolaris_Mutex_Init_2Name[] =
+ "solaris_mutex_init_2";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Mutex_Init_2List[] =
+ "|pthread.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzSolaris_Mutex_Init_2Machs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Mutex_Init_2Select0[] =
"@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
-#define SOLARIS_MUTEX_INIT_TEST_CT 1
-static tTestDesc aSolaris_Mutex_InitTests[] = {
- { TT_EGREP, zSolaris_Mutex_InitSelect0, (regex_t*)NULL }, };
+#define SOLARIS_MUTEX_INIT_2_TEST_CT 1
+static tTestDesc aSolaris_Mutex_Init_2Tests[] = {
+ { TT_EGREP, zSolaris_Mutex_Init_2Select0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Solaris_Mutex_Init
+ * Fix Command Arguments for Solaris_Mutex_Init_2
*/
-static const char* apzSolaris_Mutex_InitPatch[] = {
+static const char* apzSolaris_Mutex_Init_2Patch[] = {
"format",
"#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n\
%0\n\
*
* List of all fixes
*/
-#define REGEX_COUNT 162
+#define REGEX_COUNT 163
#define MACH_LIST_SIZE_LIMIT 279
-#define FIX_COUNT 150
+#define FIX_COUNT 151
/*
* Enumerate the fixes
RS6000_PARAM_FIXIDX,
SCO_STATIC_FUNC_FIXIDX,
SCO_UTIME_FIXIDX,
- SOLARIS_MUTEX_INIT_FIXIDX,
+ SOLARIS_MUTEX_INIT_1_FIXIDX,
+ SOLARIS_MUTEX_INIT_2_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX,
SOLARIS_WIDEC_FIXIDX,
STATSSWTCH_FIXIDX,
SCO_UTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSco_UtimeTests, apzSco_UtimePatch, 0 },
- { zSolaris_Mutex_InitName, zSolaris_Mutex_InitList,
- apzSolaris_Mutex_InitMachs,
- SOLARIS_MUTEX_INIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aSolaris_Mutex_InitTests, apzSolaris_Mutex_InitPatch, 0 },
+ { zSolaris_Mutex_Init_1Name, zSolaris_Mutex_Init_1List,
+ apzSolaris_Mutex_Init_1Machs,
+ SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY,
+ aSolaris_Mutex_Init_1Tests, apzSolaris_Mutex_Init_1Patch, 0 },
+
+ { zSolaris_Mutex_Init_2Name, zSolaris_Mutex_Init_2List,
+ apzSolaris_Mutex_Init_2Machs,
+ SOLARIS_MUTEX_INIT_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Mutex_Init_2Tests, apzSolaris_Mutex_Init_2Patch, 0 },
{ zSolaris_Stdio_TagName, zSolaris_Stdio_TagList,
apzSolaris_Stdio_TagMachs,
};
+/*
+ * Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER
+ * incorrectly, so we replace them with versions that correspond to
+ * the definition. We also explicitly name this fix "1" and the next
+ * fix "2" because this one does not deal with the last field. This
+ * fix needs to run before the next.
+ */
+fix = {
+ hackname = solaris_mutex_init_1;
+ select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+9[567]/[0-9/]+ SMI";
+ files = pthread.h;
+ sed = "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n"
+ "/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/";
+ test_text =
+ '#ident "@(#)pthread.h 1.16 97/05/05 SMI"'"\n"
+ "#define PTHREAD_MUTEX_INITIALIZER\t{0, 0, 0}\n"
+ "#define PTHREAD_COND_INITIALIZER\t{0, 0} /* */\n";
+};
+
+
/*
* Sun Solaris defines PTHREAD_MUTEX_INITIALIZER with a trailing
* "0" for the last field of the pthread_mutex_t structure, which is
* initializer to "{0}" instead
*/
fix = {
- hackname = solaris_mutex_init;
+ hackname = solaris_mutex_init_2;
select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
files = pthread.h;
c_fix = format;
#endif /* PTHREAD_PAGE_SIZE_CHECK */
-#if defined( SOLARIS_MUTEX_INIT_CHECK )
+#if defined( SOLARIS_MUTEX_INIT_1_CHECK )
+#ident "@(#)pthread.h 1.16 97/05/05 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_MUTEX_INITIALIZER {{{0}, 0}, {{{0}}}, 0}
+#else
+#define PTHREAD_MUTEX_INITIALIZER {{{0}, 0}, {{{0}}}, {0}}
+#endif
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_COND_INITIALIZER {{{0},0}, 0} /* */
+#else
+#define PTHREAD_COND_INITIALIZER {{{0},0}, {0}} /* */
+#endif
+
+#endif /* SOLARIS_MUTEX_INIT_1_CHECK */
+
+
+#if defined( SOLARIS_MUTEX_INIT_2_CHECK )
#ident "@(#)pthread.h 1.26 98/04/12 SMI"
#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, 0}
#define PTHREAD_COND_INITIALIZER {{{0}, 0}, {0}} /* DEFAULTCV */
#endif
#define PTHREAD_RWLOCK_INITIALIZER {0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}
-#endif /* SOLARIS_MUTEX_INIT_CHECK */
+#endif /* SOLARIS_MUTEX_INIT_2_CHECK */