Skip to content

Commit

Permalink
cc: fix debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Aug 29, 2024
1 parent 6f11d8f commit 046899f
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 11 deletions.
38 changes: 36 additions & 2 deletions bld/cc/c/cmdlnrsc.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,50 @@
/****************************************************************************
*
* Open Watcom Project
*
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
*
* This file contains Original Code and/or Modifications of Original
* Code as defined in and that are subject to the Sybase Open Watcom
* Public License version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
* provided with the Original Code and Modifications, and is also
* available at www.sybase.com/developer/opensource.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
* NON-INFRINGEMENT. Please see the License for the specific language
* governing rights and limitations under the License.
*
* ========================================================================
*
* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
* DESCRIBE IT HERE!
*
****************************************************************************/


#include "cvars.h"
#include "cmdlnprs.gh"
#include "cmdlnprs.h"
#include "cmdscan.h"
#include "toggles.h"
#include "cmdlnsys.h"
#include "cgdefs.h"
#include "feprotos.h"

#include "clibext.h"


#ifdef DEVBUILD
#define __location " (" __FILE__ "," __xstr(__LINE__) ")"
#define DbgNever() (CFatal( "should never execute this" __location ))
#define DbgNever() (FEMessage( FEMSG_FATAL, "should never execute this" __location ))
#else
#define DbgNever()
#endif
Expand Down
38 changes: 36 additions & 2 deletions bld/cc/c/cmdlnx86.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
/****************************************************************************
*
* Open Watcom Project
*
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
*
* This file contains Original Code and/or Modifications of Original
* Code as defined in and that are subject to the Sybase Open Watcom
* Public License version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
* provided with the Original Code and Modifications, and is also
* available at www.sybase.com/developer/opensource.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
* NON-INFRINGEMENT. Please see the License for the specific language
* governing rights and limitations under the License.
*
* ========================================================================
*
* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
* DESCRIBE IT HERE!
*
****************************************************************************/


#include "cvars.h"
#include "cmdlnprs.gh"
#include "cmdlnprs.h"
#include "cmdscan.h"
#include "toggles.h"
#include "cmdlnsys.h"
#include "cgdefs.h"
#include "feprotos.h"

#include "clibext.h"

Expand All @@ -25,8 +60,7 @@
#endif

#ifdef DEVBUILD
#define __location " (" __FILE__ "," __xstr(__LINE__) ")"
#define DbgNever() (CFatal( "should never execute this" __location ))
#define DbgNever() (FEMessage( FEMSG_FATAL, "should never execute this" __location ))
#else
#define DbgNever()
#endif
Expand Down
7 changes: 2 additions & 5 deletions bld/cc/c/coptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@


#ifdef DEVBUILD
#define __location " (" __FILE__ "," __xstr(__LINE__) ")"
#define DbgNever() (CFatal( "should never execute this" __location ))
#define DbgNever() (FEMessage( FEMSG_FATAL, "should never execute this" __location ))
#else
#define DbgNever()
#endif
Expand Down Expand Up @@ -806,14 +805,12 @@ static void AnalyseAnyTargetOptions( OPT_STORAGE *data )
OPT_STRING *str;
while( (str = data->tp_value) != NULL ) {
data->tp_value = str->next;
PragmaSetToggle( str->data, 1, false );
SetToggleFlag( str->data, 1, false );
CMemFree( str );
}
}
if( data->zi ) {
CompFlags.extra_stats_wanted = true;
// try to prevent distortions caused by debug stuff
TOGGLEDBG( no_mem_cleanup ) = true;
}
#endif
SetCharacterEncoding( data );
Expand Down
2 changes: 0 additions & 2 deletions bld/cc/c/ppexpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@
#define IS_OPERAND( token ) ( IS_ID_OR_KEYWORD( token ) || token == T_CONSTANT )

#ifdef DEVBUILD
#define __xstr(x) #x
#define __location " (" __FILE__ "," __xstr(__LINE__) ")"
#define DbgDefault( msg ) default: CFatal( msg __location )
#else
#define DbgDefault( msg )
Expand Down
5 changes: 5 additions & 0 deletions bld/cc/h/cvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
#define CheckEqSymLevel(p) ((p)->level == (id_level_type)SymLevel)
#define CheckLtSymLevel(p) ((p)->level < (id_level_type)SymLevel)

#ifdef DEVBUILD
#define __xstr(x) #x
#define __location " (" __FILE__ "," __xstr(__LINE__) ")"
#endif

/* Macros to skip all typedefs and arrive at the underlying type */
#define SKIP_TYPEDEFS( typeptr ) \
while( typeptr->decl_type == TYP_TYPEDEF ) { \
Expand Down

0 comments on commit 046899f

Please sign in to comment.