Skip to content

Commit 85b317b

Browse files
committed
clib: use near for internal CRTL functions
1 parent 320d8f0 commit 85b317b

7 files changed

Lines changed: 22 additions & 12 deletions

File tree

bld/clib/startup/a/adstart.asm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;*
33
;* Open Watcom Project
44
;*
5-
;* Copyright (c) 2002-2022 The Open Watcom Contributors. All Rights Reserved.
5+
;* Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
66
;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
;*
88
;* ========================================================================
@@ -551,7 +551,7 @@ __exit proc near ; never return
551551
; EAX - pointer to message to print
552552
; EDX - exit code
553553

554-
__do_exit_with_msg_: ; never return
554+
__do_exit_with_msg_ proc near ; never return
555555
push edx ; save return code on stack
556556
push eax ; save msg
557557
mov edx,offset ConsoleName
@@ -585,6 +585,7 @@ else ; ACAD
585585
mov ah,04cH ; DOS call to exit with return code
586586
int 021h ; back to DOS
587587
endif ; ACAD
588+
__do_exit_with_msg_ endp
588589

589590
__exit endp
590591

bld/clib/startup/a/cstrt086.asm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;*
33
;* Open Watcom Project
44
;*
5-
;* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
5+
;* Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
66
;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
;*
88
;* ========================================================================
@@ -455,7 +455,7 @@ endif
455455
; DX:AX - far pointer to message to print
456456
; BX - exit code
457457

458-
__do_exit_with_msg_:
458+
__do_exit_with_msg_ proc near
459459
mov sp,offset DGROUP:_end+80h; set a good stack pointer
460460
push bx ; save return code
461461
push ax ; save address of msg
@@ -501,6 +501,7 @@ endif
501501
pop ax ; restore return code from stack
502502
mov ah,04cH ; DOS call to exit with return code
503503
int 021h ; back to DOS
504+
__do_exit_with_msg_ endp
504505
__exit endp
505506

506507
;

bld/clib/startup/a/cstrt386.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ endif
377377
; EAX - pointer to message to print
378378
; EDX - exit code
379379

380-
__do_exit_with_msg_: ; never return
380+
__do_exit_with_msg_ proc near ; never return
381381
push edx ; save return code
382382
push eax ; save address of msg
383383
mov edx,offset ConsoleName
@@ -406,6 +406,8 @@ L7:
406406
pop eax ; restore return code from stack
407407
mov ah,04cH ; DOS call to exit with return code
408408
int 021h ; back to DOS
409+
__do_exit_with_msg_ endp
410+
409411
__exit endp
410412

411413
;

bld/clib/startup/a/cstrtx32.asm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;*
33
;* Open Watcom Project
44
;*
5-
;* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
5+
;* Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
66
;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
;*
88
;* ========================================================================
@@ -380,7 +380,7 @@ null_error: ; a null code pointer has been called
380380
; EAX - pointer to message to print
381381
; EDX - exit code
382382

383-
__do_exit_with_msg_:
383+
__do_exit_with_msg_ proc near
384384
push edx ; save return code
385385
push eax ; save address of msg
386386
mov edx,offset DGROUP:ConsoleName
@@ -409,6 +409,8 @@ L5:
409409
pop eax ; restore return code from stack
410410
mov ah,4cH ; DOS call to exit with return code
411411
int 021h ; back to DOS
412+
__do_exit_with_msg_ endp
413+
412414
__exit endp
413415

414416
;

bld/clib/startup/a/dllstart.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ error_exit:
356356
; may be only called from startup code, after that there is
357357
; nowhere to exit to!
358358

359-
__do_exit_with_msg_:
359+
__do_exit_with_msg_ proc near
360360
push edx ; save return code
361361
push eax ; save address of msg
362362
mov edx,offset ConsoleName
@@ -393,6 +393,8 @@ do_exit:
393393
lss esp,caller_stack
394394
mov caller_ss,0 ; caller_ss is used as a flag if do_exit can be jumped to
395395
ret
396+
__do_exit_with_msg_ endp
397+
396398
__DLLstart_ endp
397399

398400
__exit proc far

bld/clib/startup/a/dos16m.asm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;*
33
;* Open Watcom Project
44
;*
5-
;* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
5+
;* Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
66
;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
;*
88
;* ========================================================================
@@ -464,7 +464,7 @@ __exit proc far
464464
; DX:AX - far pointer to message to print
465465
; BX - exit code
466466

467-
__do_exit_with_msg_:
467+
__do_exit_with_msg_ proc near
468468
mov sp,offset DGROUP:_end+80h; set a good stack pointer
469469
push bx ; save return code
470470
push ax ; save address of msg
@@ -508,6 +508,8 @@ no_ovl: ; endif
508508
pop ax ; restore return code
509509
mov ah,04cH ; DOS call to exit with return code
510510
int 021h ; back to DOS
511+
__do_exit_with_msg_ endp
512+
511513
__exit endp
512514

513515
;

bld/clib/startup/h/doexitwm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2018-2018 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2018-2025 The Open Watcom Contributors. All Rights Reserved.
66
*
77
* ========================================================================
88
*
@@ -15,7 +15,7 @@
1515
// - always uses register calling convention
1616
// - this function is only called from the C implementation for DOS
1717
// of __exit_with_msg
18-
extern _WCNORETURN void __do_exit_with_msg( char _WCI86FAR *, int );
18+
extern _WCNORETURN void _WCNEAR __do_exit_with_msg( char _WCI86FAR *, int );
1919
#if defined( _M_I86 )
2020
#pragma aux __do_exit_with_msg "*_" __parm __caller [__ax __dx] [__bx]
2121
#elif defined( _M_IX86 )

0 commit comments

Comments
 (0)